Skip to content

[mypyc] feat: optimize C code for str.count #19582

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BobTheBuidler
Copy link
Contributor

@BobTheBuidler BobTheBuidler commented Aug 4, 2025

When looking over these C functions I added in #19264 I realized we're doing a conversion for no real reason, and it is better to let mypyc's builder decide whether or not a conversion is necessary. It might be the case that we already have a py_ssize_t value(s) available to pass directly into the C-API function.

@BobTheBuidler
Copy link
Contributor Author

Huh. Not sure if this will work as I intended. I thought the builder was able to automagically handle the conversion to py_ssize_t.

Will leave open for a few days in the hopes that somebody might have a useful pointer here. Then will either finish or close.

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.

1 participant