Skip to content

PERF: faster searchsorted in tzconversion #46329

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 2 commits into from
Mar 11, 2022

Conversation

jbrockmendel
Copy link
Member

ts = pd.Timestamp(0)
ts2 = ts.tz_localize("US/Pacific")

%timeit ts.tz_localize("US/Pacific")
35.1 µs ± 385 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <- main
16.8 µs ± 312 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)  # <- PR

%timeit ts2.tz_localize(None)
5.1 µs ± 54.5 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)  # <- main
2.7 µs ± 68.4 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)  # <- PR

@jreback jreback added the Timezones Timezone data dtype label Mar 11, 2022
@jreback jreback added this to the 1.5 milestone Mar 11, 2022
@jreback jreback added the Performance Memory or execution speed performance label Mar 11, 2022
@jreback jreback merged commit c832ccb into pandas-dev:main Mar 11, 2022
@jbrockmendel jbrockmendel deleted the perf-searchsorted branch March 12, 2022 00:35
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
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