A new general dispatch mechanism to speed up various slow Raku constructs
summary
A new dispatch op in MoarVM records small dispatch programs (terminals like boot value and boot code) and lets user-space NQP dispatchers emit guarded, inlined actions so call sites become monomorphic or polymorphic caches instead of megamorphic slow paths. The prototype passes 99.6% of Rakudo tests, already speeds multi dispatch where-clauses by ~3–4× without full optimizer integration, and plans resumptions and native-call terminals next.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:05What is dispatch
- 7:54Dispatch in MoarVM
- 13:28Why MoarVM changed
- 18:02Performance cliffs
- 22:17Limitations of current approach
- 23:41New dispatch mechanism
- 31:01User-space dispatchers
- 39:46Optimizer integration
- 40:49Current results
- 46:09Future improvements
- 49:18Q&A
related talks
16mContextual Dispatch for Function Specialization
22mRevisiting Dynamic Dispatch for Modern Architectures
29mPredicate Dispatch
40mImplementation Details of Ruby 2.0 VM
40mJoy of Meta-Tracing Just-in-Time Compilation: More Than Just a VM Generator
19mReusing Just-in-Time Compiled Code
37mMessage in a Bottle
26mAn Analysis of Compiled Code Reusability in Dynamic Compilation
