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-117431: Adapt str.find and friends to use the METH_FASTCALL calling convention#117468

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

Merged

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedApr 2, 2024
edited by bedevere-appbot
Loading

@erlend-aaslanderlend-aasland marked this pull request as ready for reviewApril 3, 2024 07:15
@erlend-aasland
Copy link
ContributorAuthor

Similar speedsups as withstr.startswith andstr.endswith:

#main$./python.exe -m timeit -s"s = 'abcdef'""s.count('a')"5000000 loops, best of 5: 92.5 nsec per loop#This PR$./python.exe -m timeit -s"s = 'abcdef'""s.count('a')"10000000 loops, best of 5: 26.2 nsec per loop

@erlend-aasland
Copy link
ContributorAuthor

Thanks for the review, Inada-san.

@erlend-aaslanderlend-aasland merged commit7ecd55d intopython:mainApr 3, 2024
@erlend-aaslanderlend-aasland deleted the perf/str.find-and-friends branchApril 3, 2024 15:59
erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull requestApr 6, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull requestApr 17, 2024
…n#117468)This change gives a significant speedup, as the METH_FASTCALL callingconvention is now used. The following methods are adapted:- str.count- str.find- str.index- str.rfind- str.rindex
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Eclips4Eclips4Eclips4 left review comments

@methanemethanemethane approved these changes

@JelleZijlstraJelleZijlstraAwaiting requested review from JelleZijlstra

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@erlend-aasland@methane@Eclips4

[8]ページ先頭

©2009-2025 Movatter.jp