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-92777: Add LOAD_METHOD_LAZY_DICT #92778
base: main
Are you sure you want to change the base?
Conversation
Hah, looks like I was wrong, it wasn't that straightforward after all :). |
…nner/cpython into load_method_lazy_dict
A few minor issues, but generally looks good.
What are the stats for the LOAD_METHOD_LAZY_DICT
instruction?
How do you collect stats for pyperformance and create that nice table on faster-cpython? I'm frankly clueless (I only know how to use the one that dumps stats out to the terminal or file). Sorry. On test suite code, I get a 0.3% improvement on hits and 0.6% more misses. But I want to point out that
|
Wow looks like my expectations were proven wrong by the stats again, after removing The part of the stdlib I've found that frequently uses this instruction is the I'm not feeling too confident about this optimization now. It seems like something that would boost our pyperformance numbers but maybe not in the real world?
|
Generating the table is somewhat manual and hacky. I mean to automate it, but for now here's the procedure:
The table is created by running |
Fixes #92777. Specialize LOAD_METHOD for lazy dictionaries. This accounts for 40% of the misses.
I'm sad that I missed 3.11 beta freeze for this specialization. It's straightforward and is likely to account for the majority of LOAD_METHOD in real world code since lazy
__dict__
is now commonplace.