World Age in Julia: Optimizing Method Dispatch in the Presence of Eval
summary
Julia uses a world-age semantics that delays visibility of methods added by eval until between top-level calls, enabling safe inlining and avoiding deoptimizations; the authors build a formal model called Juliette calculus and prove dispatch optimizations correct. They statically analyze ~4,000 packages and report more than two thirds avoid eval/invokelatest, with an estimated 4–9% of packages bypassing world age. Eval always runs unoptimized and invokelatest is slower than normal calls, trading flexibility for predictable performance.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:01What is Eval
- 5:26World Age semantics
- 9:05Formalization
- 12:05Optimizations
- 12:51Summary
related talks
22mJulia - Dynamism and Performance Reconciled by Design
23mPerformant Dynamically Typed E-Graphs in Pure Julia
19mReusing Just-in-Time Compiled Code
01h 21mNon-local compiler transformations in the presence of dynamic dispatch
24mEfficient Late Binding of Dynamic Function Compositions
13mType Stability in Julia: Avoiding Performance Pathologies in JIT Compilation
53mFROM SCALA TO ASSEMBLY THE COST OF ABSTACTION REVISITED
31mSimplifying and Optimizing Life on the Edge with Graal
