Uh oh!
There was an error while loading. Please reload this page.
bpo-45565: Specialize LOAD_ATTR_CLASS - #29146
Conversation
Fidget-Spinner
commented
Oct 22, 2021
Stats for |
markshannon
commented
Oct 22, 2021
Do you have stats for the standard benchmark suite (or something of similar scale), and have you benchmarked this? A couple of things that stand out:
|
No, I'll get some soon (pyperformance is a pain on Windows :().
The only possible way for deopt is for tp_version_tag to change, and that requires the class variable to be written to. So things like: classX:
x=1X.x=2Unfortunately, I have no clue how common something like this is in the real world. An alternative approach (with far fewer invalidations):
At runtime, look into The benefit is that
Indeed, I failed to see that |
Fidget-Spinner
commented
Oct 22, 2021
Wow, somehow the stats for the alternative approach (mentioned above) is almost exactly the same as the old one using |
Uh oh!
There was an error while loading. Please reload this page.
Some comments: classX:
x=1for_inrange(20):
X.xprint(_testcapi.type_get_version(X))
X.x=NoneHowever, approach 2 using MRO index works even with the test case above, some stats for the code: |
This PR is stale because it has been open for 30 days with no activity. |
iritkatriel
commented
Sep 9, 2022
@Fidget-Spinner Is this abandoned, or are you planning to continue working on it? |
Fidget-Spinner
commented
Sep 10, 2022
@iritkatriel this was completed in #93430). Thanks for the reminder! |
Almost same as
LOAD_METHOD_CLASS.https://bugs.python.org/issue45565