Skip to content

PERF: delta_to_nanoseconds #47254

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
Jun 6, 2022

Conversation

jbrockmendel
Copy link
Member

from datetime import timedelta
from pandas._libs.tslibs.timedeltas import *

td = timedelta(days=4)

%timeit delta_to_nanoseconds(td)
1.74 µs ± 25.2 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)  # <- main
300 ns ± 3.38 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)  # <- PR
265 ns ± 7.28 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)  # <- 1.4.2

@mroeschke mroeschke added Performance Memory or execution speed performance Timedelta Timedelta data type labels Jun 6, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jun 6, 2022
@mroeschke mroeschke merged commit 3919997 into pandas-dev:main Jun 6, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the perf-delta_to_nanoseconds branch June 6, 2022 18:04
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 Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants