-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement
Description
Top-of-stack caching is technique where one or more values on the top of the stack are kept in local variables, with the assumption that the C compiler will put them in registers.
We should implement this for the interpreter (tier 1).
We cannot afford to increase the number of instructions by much, so we'll have to use a fixed size cache of 1.
This will likely only produce a modest speedup, as the total memory traffic is unlikely to decrease. There should be some ILP improvements.
The main benefit of TOS caching is likely to be in the JIT where we can use a variable sized cache.
We want to do it in the interpreter first though, as it will be simpler and requires a subset of the changes needed for the JIT.
Linked PRs
- GH-131498: Remove conditional stack effects #131499
- GH-131498: Another refactoring of the code generator #131827
- GH-131498: Cases generator: Parse down to C statement level. #131948
- GH-131498: manage stacks automatically #132074
- GH-131498: Allow 'peek' variables to be modified #132506
- GH-131498: Replace single-element arrays with scalars in
bytecodes.c
#132615
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetype-featureA feature request or enhancementA feature request or enhancement