-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Special-case string formatting in BINARY_MODULO implementation #49426
Comments
This patch speeds up the string formatting % operator by avoiding the Performance tested with gcc 4.3.1 x86_64 on Linux 2.6.18: 2to3: Django: Spitfire [1]: The Django test renders a 150x150 cell table 100 times. The Spitfire Pickling: This is pickling a list of 40000 dicts 100 times. This does not impact About the patch: |
I think this is only valid when PyString_CheckExact is true. A subclass I'm somewhat interested to see how a primarily-numeric benchmark |
Updated the patch to use only PyString_CheckExact(); added a test for There's a very slight performance hit when using % with numbers, but For some reason, using PyString_CheckExact instead of New benchmark numbers: 2to3: Django: SlowPickle: |
Looks good to me. |
Committed as r69811. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: