Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby
summary
Claim: TruffleRuby + Graal JIT compiles Ruby down via partial evaluation and inlining to remove allocations and hot paths, producing native code that hits ~170–300 FPS on optcarrot (demo: 28 FPS → ~200 FPS, ~7×), and microbenchmarks 10–30× over CRuby. Engine builds shared fixed storage and shared dynamic storage for arrays/hashes so index reads scale to ~44 cores (near 44×) and reach ~30 billion element reads/sec; dynamic operations use fine-grained locks so single-threaded cost is negligible and parallel safety holds.
AI-written summary · about
chapters (15)
- 0:00Introduction and speaker
- 1:02What is TruffleRuby
- 2:28Ruby 3x3 performance goals
- 3:09OptCarrot benchmark demo
- 7:57TruffleRuby performance results
- 10:49How TruffleRuby achieves speed
- 23:55Parallel and thread-safe Ruby
- 24:16Challenges with Ruby threads
- 33:08Thread-safe collections in Ruby
- 36:00Sharing-based synchronization
- 41:08Concurrent array strategies
- 44:42TruffleRuby conclusions
- 46:07General conclusions
- 47:11Future of TruffleRuby
- 49:01Q&A session
related talks
43mParallel and Thread-Safe Ruby at High-Speed with TruffleRuby
38m"Parallel and Thread-Safe Ruby at High-Speed with TruffleRuby"
23mParallelization of Dynamic Languages - Synchronizing Built-in Collections
41mHigh Performance Ruby
30mFast Metaprogramming with Truffle
35mRuby’s C Extension Problem and How We're Solving It
22mInvariants in my own Ruby: some things must never change
24mJust-in-Time Compiling Ruby Regexps on TruffleRuby
