Contextual Dispatch for Function Specialization
summary
Built a JIT called Ř JIT compiler that specializes functions to dynamic call-site properties using contextual dispatch: contexts form a comparable lattice (types, shapes, non-reflectiveness, arg counts), versions live in a linearized dispatch table, and a heuristic adds new versions when suboptimal choices recur. Evaluated against GNU R and FastR (Truffle/Graal), the VM runs about 1.7× vs GNU R, is slower but more predictable than FastR, and 18 of 46 benchmarks show measurable improvement from contextual dispatch.
AI-written summary · about
chapters (8)
- 0:00Intro
- 0:57Problem: Laziness + Reflection
- 3:38Versioned Functions
- 6:37Current Context
- 7:40Incremental Computation
- 8:39Dispatch
- 10:54Best Target?
- 12:19Results
related talks
19mReusing Just-in-Time Compiled Code
28mReducing Feedback Pollution
22mRevisiting Dynamic Dispatch for Modern Architectures
50mA new general dispatch mechanism to speed up various slow Raku constructs
29mPredicate Dispatch
26mAn Analysis of Compiled Code Reusability in Dynamic Compilation
25mHybrid Execution: Combining Ahead-of-Time and Just-in-Time Compilation
40mJoy of Meta-Tracing Just-in-Time Compilation: More Than Just a VM Generator
