My plan is for this initial PR to lay the groundwork, then to work on porting over the existing opcode caches one-by-one. Once that's done, we can clean up lots of the "old" machinery.
I don't think we should have a show_cache option, as the caches are meaningless junk without quickening (maybe we should drop the CACHE opcode, and just use zeroes).
Instead we should have a show_quickened option, to show the quickened form, which we need to make clear is very much implementation defined.
E.g. Cinder might show the machine code as well.
That way, we can present the cache information as extra data on the quickened form, rather than junk instructions.
Activity
brandtbucher commented on Feb 24, 2022
...as discussed in faster-cpython/ideas#263.
My plan is for this initial PR to lay the groundwork, then to work on porting over the existing opcode caches one-by-one. Once that's done, we can clean up lots of the "old" machinery.
markshannon commented on Feb 24, 2022
We need to decide what to do about dis.
I don't think we should have a show_cache option, as the caches are meaningless junk without quickening (maybe we should drop the CACHE opcode, and just use zeroes).
Instead we should have a show_quickened option, to show the quickened form, which we need to make clear is very much implementation defined.
E.g. Cinder might show the machine code as well.
That way, we can present the cache information as extra data on the quickened form, rather than junk instructions.
markshannon commented on Feb 25, 2022
New changeset 0f41aac by Brandt Bucher in branch 'main':
bpo-46841: Use inline caching for BINARY_OP (GH-31543)
0f41aac
markshannon commented on Feb 25, 2022
Making this a release blocker, as we really cannot leave this half finished for the release.
Shouldn't be a problem, as we'll have it done in a week or so.
markshannon commented on Feb 28, 2022
New changeset 424ecab by Brandt Bucher in branch 'main':
bpo-46841: Use inline caching for UNPACK_SEQUENCE (GH-31591)
424ecab
35 remaining items
GH-90997: Document CACHEs (GH-95694)
pythonGH-90997: Document CACHEs (pythonGH-95694)
GH-90997: Document CACHEs (GH-95694) (GH-95696)
pythonGH-90997: Document CACHEs (pythonGH-95694)
GH-90997: Wrap yield from/await in a virtual try/except StopIteration (…
iritkatriel commented on Sep 7, 2022
Is there anything left to do here?
markshannon commented on Sep 7, 2022
No. This is done.
GH-90997: Improve inline cache performance for MSVC (GH-96781)
GH-90997: Shrink the LOAD_GLOBAL caches (#102569)
pythonGH-90997: Shrink the LOAD_GLOBAL caches (python#102569)