8000 bpo-37207: Use PEP 590 vectorcall to speed up frozenset() by corona10 · Pull Request #19053 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-37207: Use PEP 590 vectorcall to speed up frozenset() #19053

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

Merged
merged 7 commits into from
Mar 18, 2020

Conversation

corona10
Copy link
Member
@corona10 corona10 commented Mar 18, 2020
Mean +- std dev: [master] 2.26 us +- 0.06 us -> [pr] 2.06 us +- 0.05 us: 1.09x faster (-9%) 

https://bugs.python.org/issue37207

@corona10
Copy link
Member Author
corona10 commented Mar 18, 2020

The benchmark from the https://bugs.python.org/issue37207#msg364428 was executed by below script.

import pyperf

runner = pyperf.Runner()
runner.timeit(name="frozenset create test",
              stmt="frozenset([1, 2, 3, 4, 5])")

< 8000 div class="js-socket-channel js-updatable-content" data-channel="eyJjIjoicmVwbzo4MTU5ODk2MTpjb21taXQ6YjM3NDhmYjljNDAyMWFkNTdhMTFkNTk3ZTIwZmI2NDBiYzRjNTgxZCIsInQiOjE3NDkzMTE4NDh9--d88bbdd68d3306d689bed1c632ab04190682dce61518dbf4ab083b4da1ac37b2" data-url="/python/cpython/pull/19053/partials/commit_status_icon?oid=b3748fb9c4021ad57a11d597e20fb640bc4c581d">
@corona10 corona10 force-pushed the bpo-37207-frozenset branch from 6ae0f81 to 27db91d Compare March 18, 2020 14:26
@corona10 corona10 changed the title bpo-37207: Use PEP 590 vectorcall to speed up frozenset() [WIP] bpo-37207: Use PEP 590 vectorcall to speed up frozenset() Mar 18, 2020
@corona10 corona10 changed the title [WIP] bpo-37207: Use PEP 590 vectorcall to speed up frozenset() bpo-37207: Use PEP 590 vectorcall to speed up frozenset() Mar 18, 2020
@corona10 corona10 requested a review from vstinner March 18, 2020 14:47
@corona10
Copy link
Member Author

@vstinner

Updated, During I work on helper function, I updated my git client and
during this process, it makes duplicated commits 27db91d d467294 .
I resolved all confliction and now it works okay. I also checked reference leak
through ./python.exe -m test test_set -R 3:3and there was no leak ;-)

@corona10
Copy link
Member Author

And performance improvement is still valid.

Mean +- std dev: [master] 2.30 us +- 0.10 us -> [pr] 2.10 us +- 0.06 us: 1.10x faster (-9%)

@corona10 corona10 requested a review from vstinner March 18, 2020 16:38
@vstinner vstinner merged commit 1c60567 into python:master Mar 18, 2020
@vstinner
Copy link
Member
vstinner 90C3 commented Mar 18, 2020

Thanks @corona10: 1.09x faster (-9%) is nice to have (-200 ns). And IMHO the change makes the code more readable with new comments.

@corona10 corona10 deleted the bpo-37207-frozenset branch March 18, 2020 17:33
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.

4 participants
0