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-136066: simplifyplatform._platform()#136069

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
picnixz wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
frompicnixz:refactor/platform/strip-136066

Conversation

picnixz
Copy link
Member

@picnixzpicnixz commentedJun 28, 2025
edited by bedevere-appbot
Loading

Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

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

Can you please provide a benchmark for realistical platforms and some unrealistically big ones?

picnixz reacted with thumbs up emoji
@picnixz
Copy link
MemberAuthor

picnixz commentedJun 28, 2025
edited
Loading

Can you please provide a benchmark for realistical platforms and some unrealistically big ones?

For realistic ones, there should be no difference (because the strings are REALLY small). For unrealistically big ones, I'll write them.

@picnixzpicnixz changed the titlegh-136066: reduce asymptotic complexity ofplatform._platform()gh-136066: simplifyplatform._platform()Jun 28, 2025
@picnixzpicnixz added the type-refactorCode refactoring (with no changes in behavior) labelJun 28, 2025
@picnixz
Copy link
MemberAuthor

For the benchmarks:

./python -m pyperf timeit -s'import platform; s="-" *1_000_000''platform._platform(s)'

On a PGO+LTO build:

Mean +- std dev: [ref] 5.83 ms +- 0.12 ms -> [new] 881 us +- 11 us: 6.62x faster

Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

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

Awesome results! Thank you!

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

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

@sobolevnsobolevnsobolevn approved these changes

Assignees
No one assigned
Labels
awaiting mergeskip newstype-refactorCode refactoring (with no changes in behavior)
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@picnixz@serhiy-storchaka@sobolevn

[8]ページ先頭

©2009-2025 Movatter.jp