Purpose
- Design a state machine for function lifecycle that maximizes the performance of ZJIT.
- Every state transition of a function should have a tuning knob that can be tuned easily.
Considerations
Possible tuning knobs to consider when designing function lifecycle:
- State transition:
- How many times should we profile (or run non-profiling cycles) before compiling a version?
- What kind of events (certain kinds of exits or invalidations) should trigger recompilation?
- Versioning:
- How many versions should we compile for each function?
- What compilation policy should we use for each version?
- Profiling
- Should we have a profiling tier in JIT?
- Can it profile something that the interpreter can't profile?
- Would we afford to collect more profiles if we profiled faster?
- How much extra memory do we need to generate JIT code for profiling?
- Are there anything we aren't profiling but is profitable for JIT?
- Branch probability
- Profiles on a megamorphic ISEQ that is inlined by multiple JIT functions
TODO
Purpose
Considerations
Possible tuning knobs to consider when designing function lifecycle:
TODO