-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-132042: Remove resolve_slotdups to speedup class creation #132156
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
gh-132042: Remove resolve_slotdups to speedup class creation #132156
Conversation
Maybe take a look at this comment and have it in mind. |
@StanFromIreland Yeah, thanks! I just checked both scripts - and timing closely same. But I not finished main task, so results can changed. |
Intermediate results: Benchmark results (outdated)
|
I added tests from gh-76527 (script for testing with pyperf b.txt):
Benchmark results (outdated)
Also benchgcclasses2.py output:
new:
Time varies, I'm not sure it is statistically significant. Count of objects closely the same. Async import time (
new:
|
Remove resolve_slotdups (new2): Benchmark results (outdated)
|
It is ready to review. Please take a look. |
Co-authored-by: Victor Stinner <[email protected]>
Fixed merge conflicts. Updated results: Geometric mean - 1.12x faster
|
Co-authored-by: Kumar Aditya <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
…sergey-miryanov/cpython into pythongh-132042-optimize-class-creation
@kumaraditya303 @vstinner Thanks for review! I will be able to run benchmarks after updates on this weekends (now on traveling laptop). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few coding style suggestions.
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement!
@kumaraditya303 thanks! |
Micro-benchmark on creating on empty class:
Result: |
Merged. Thank you, that's a nice performance enhancement! |
|
Congrats, very useful speedup! |
Thanks everyone! |
…ython#132156) Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: sobolevn <[email protected]> Co-authored-by: Kumar Aditya <[email protected]>
Removes resolve_slotdups.