Skip to content

PERF: operations with zoneinfo tzinfos #47767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

jbrockmendel
Copy link
Member

import zoneinfo
import pandas as pd

tz = zoneinfo.ZoneInfo("US/Pacific")
dti = pd.date_range("2016-01-01", periods=10**5, freq="s", tz=tz)

In [3]: %timeit dti.normalize()
142 ms ± 3.44 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- main
90.4 ms ± 4.34 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- PR

The corresponding timing with pytz is 49.9 ms. @pganssle any thoughts on getting to near-parity (so we can drop pytz xref #46463)? Is there any prospect of exposing zoneinfo_fromutc in the C-API?

@mroeschke mroeschke added Performance Memory or execution speed performance Timezones Timezone data dtype labels Jul 18, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jul 18, 2022
@mroeschke mroeschke merged commit b731518 into pandas-dev:main Jul 18, 2022
@jbrockmendel jbrockmendel deleted the perf-zoneinfo branch July 18, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants