Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Apr 3, 2024

This change gives a significant speedup, as the METH_FASTCALL calling convention is used.

@erlend-aasland erlend-aasland changed the title gh-117431: Adapt bytes abnd bytearray .find() and friends to Argument Clinic gh-117431: Adapt bytes and bytearray .find() and friends to Argument Clinic Apr 3, 2024
@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Apr 3, 2024

Note that the diff is not as frightening as GitHub wants it; subtract the generated files, and the diff is within ~200 lines of code, most of it being clinic input blocks.

Moreover, we want to update either this PR or #117468 to remove the auxiliary stringlib functions, depending on which PR lands first. UPDATE: aux stringlib function is now removed.

@erlend-aasland erlend-aasland requested a review from methane April 3, 2024 20:48
@erlend-aasland
Copy link
Contributor Author

@methane, I intend to merge this in time for the beta in May. Aiming to land it next week.

Copy link
Member

@methane methane left a comment

Choose a reason for hiding this comment

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

Although old docstring used [start,end], I want to fix them to [start:end].

@erlend-aasland
Copy link
Contributor Author

Thanks for the review, Inada-san!

@erlend-aasland erlend-aasland enabled auto-merge (squash) April 12, 2024 07:07
@erlend-aasland erlend-aasland merged commit deb921f into python:main Apr 12, 2024
@erlend-aasland erlend-aasland deleted the perf/bytes.find-and-friends branch April 12, 2024 07:40
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…ument Clinic (python#117502)

This change gives a significant speedup, as the METH_FASTCALL calling
convention is now used. The following bytes and bytearray methods are adapted:

- count()
- find()
- index()
- rfind()
- rindex()

Co-authored-by: Inada Naoki <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants