Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby
summary
TruffleRuby running on Graal/SubstrateVM uses partial evaluation and inlining to compile Ruby core and JIT across language boundaries, producing native code that hits up to ~8× Optcarrot vs Ruby 2.0, ~10× ERB, and 20–30× on some microbenchmarks. Arrays and Hashes gain thread-safe semantics by tracking when objects migrate from thread-local to shared and applying concurrent strategies (fixed vs dynamic storage) so single-thread speed stays native while scaling to tens of cores with comparable throughput to Java on NAS parallel benchmarks.
AI-written summary · about
chapters (12)
- 0:00Start
- 9:21Cpu Benchmarks
- 10:05Template Rendering
- 12:56Ruby Virtual Machine
- 14:22Partial Evaluation
- 17:31Inlining
- 23:09Summary
- 25:06Global Lock
- 38:06Share Dynamic Storage
- 39:07Layout Lock
- 39:26The Nasa Nasa Parallel Benchmark
- 40:13Conclusion
related talks
38m"Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby"
23mParallelization of Dynamic Languages - Synchronizing Built-in Collections
44mImproving TruffleRuby’s Startup Time with the SubstrateVM
42mImproving TruffleRuby’s Startup Time with the SubstrateVM
23mParallel Processing With Ruby
28mConcurrency for Rubyists
30mFast Metaprogramming with Truffle
42mLook out! Gotchas of Using Threads in Ruby
