Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
With the JIT and better tier 2 optimizations, effective specialization is becoming more important that plain speed in tier 1.
BEFORE_WITH andBEFORE_ASYNC_WITH could be specialized, but they are bulky and won't optimize well in tier 2.
Instead, we should lower them to attribute lookups and calls which can then be optimized.
We should add aLOAD_SPECIAL instruction for loading dunder methods and replaceBEFORE_WITH as follows:
COPY 1 LOAD_SPECIAL __enter__ + NULL|self SWAP 3 LOAD_SPECIAL __exit__ SWAP 3 CALL 0Likewise forBEFORE_ASYNC_WITH.
Even without any specialization ofLOAD_SPECIAL, theCALL will be specialized and the JIT can eliminate theCOPY andSWAPs.
Linked PRs
Metadata
Metadata
Assignees
Labels
No labels