-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
bpo-46841: Quicken code in-place #31888
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
Conversation
|
1% perf improvement too: |
|
This is still marked as draft, what is left to do? |
There is still an awkward spot in I’m still trying to understand the code better and figure out a cleaner way of doing this. Any ideas? |
#31968 should help. |
|
I think it is OK to sort out the peculiarities of |
|
🤖 New build scheduled with the buildbot fleet by @brandtbucher for commit c8054b9 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
|
Buildbot failures are all pre-existing failures and unrelated to this PR. |
This moves the bytecode to the end of the corresponding
PyCodeObject, and quickens it in-place.Related changes:
PyCodeObjectis now more compact. I've removed the almost-always-unusedco_varnames,co_freevars, andco_cellvarsmember caches, and rearranged someintmembers to fill some holes in the struct on 64-bit builds.co_codehas been removed and replaced with_PyCode_GetCode, andco_quickenedandco_firstinstrhave been replaced with_PyCode_CODE._PyOpcode_Deoptis a new mapping from all opcodes to their un-quickened forms._PyOpcode_InlineCacheEntriesis renamed to_PyOpcode_Caches,_Py_IncrementCountAndMaybeQuickenis renamed to_PyCode_Warmup,_Py_Quickenis renamed to_PyCode_Quicken, and_co_quickenedis renamed to_co_code_adaptive(and is now a read-onlymemoryview).https://bugs.python.org/issue46841