Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-88473: Implement fast path in date.today() for date types#130980

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
StanFromIreland wants to merge6 commits intopython:main
base:main
Choose a base branch
Loading
fromStanFromIreland:date_speedup

Conversation

StanFromIreland
Copy link
Contributor

@StanFromIrelandStanFromIreland commentedMar 8, 2025
edited by bedevere-appbot
Loading

Other suggested implementations are not as backward compatible.

$ ./python -m timeit -s 'from datetime import date' 'date.today()'1000000 loops, best of 5: 271 nsec per loop$ python3.14 -m timeit -s 'from datetime import date' 'date.today()'200000 loops, best of 5: 1.36 usec per loop

~5x faster for date types

@picnixz
Copy link
Member

Are the benchmarks realised on a PGO build or a debug build? or maybe PGO+LTO? or just release build?

@StanFromIreland
Copy link
ContributorAuthor

Both are just plain builds. python3.14 is from the morning but I doubt the few commits matter.

@picnixz
Copy link
Member

By plain builds, do you mean with or withou--with-pydebug? I assume without so it's probably release builds so it should be fine. But please the configure flags

@StanFromIreland
Copy link
ContributorAuthor

@pganssle can you take a look at this?

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

On my part, it looks good but I'll let a datetime expert have the final decision.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@StanFromIreland
Copy link
ContributorAuthor

Friendly ping@pganssle Any comments on this?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz approved these changes

@pgansslepganssleAwaiting requested review from pgansslepganssle is a code owner

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@StanFromIreland@picnixz

[8]ページ先頭

©2009-2025 Movatter.jp