gh-131798: fold super method lookups in JIT#148231
Open
kumaraditya303 wants to merge 8 commits intopython:mainfrom
Open
gh-131798: fold super method lookups in JIT#148231kumaraditya303 wants to merge 8 commits intopython:mainfrom
kumaraditya303 wants to merge 8 commits intopython:mainfrom
Conversation
Member
|
I see a 10% speedup on richards_super with this PR! Mean +- std dev: [richards_super_main] 28.8 ms +- 0.5 ms -> [richards_super_fold] 26.1 ms +- 0.5 ms: 1.10x faster |
Member
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Looks good, just one stylistic nit. Thanks!
| return sym_new_not_null(ctx); | ||
| } | ||
| /* Normal case: obj_type must be a subtype of su_type */ | ||
| if (!PyType_IsSubtype(obj_type, su_type)) { |
Member
There was a problem hiding this comment.
Note to self: this is not same as subclasscheck/instancecheck, which can call arbitrary code.
Member
|
Please fix the merge conflicts. LOAD_CONST_UNDER_INLINE_BORROW was removed as it's a duplicate of _INSERT_1_LOAD_CONST_INLIE_BORROW #148235 |
Contributor
Author
Fixed. |
Fidget-Spinner
approved these changes
Apr 8, 2026
| _Py_BloomFilter_Add(dependencies, su_type); | ||
| PyType_Watch(TYPE_WATCHER_ID, (PyObject *)obj_type); | ||
| _Py_BloomFilter_Add(dependencies, obj_type); | ||
| return sym_new_const_steal(ctx, lookup); |
Member
There was a problem hiding this comment.
Note to self: need steal version because _PySuper_Lookup returns a strong reference, unlike _PyType_Lookup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.