High Performance Ruby
summary
JRuby runs Ruby on the JVM and claims multi× speedups by teaching the JVM Ruby semantics via invokedynamic, using class-level method cache serials and class-held instance variable offsets so lookups become direct memory accesses. Benchmarks show a pure Ruby red‑black tree (100,000 nodes) dropping from ~4–4.5s on MRI 1.9 to ~0.8s on JRuby+invokedynamic; empty-method microbenchmarks mislead. Remaining work: closures, super/missing call patterns, native C‑extension incompatibilities, GC and parallelism improvements; progress is real but incomplete.
AI-written summary · about
chapters (34)
- 0:00Intro
- 2:27High Performance?
- 3:33Fast Enough
- 4:09Performance Wall
- 5:06Native Extensions
- 5:48What We Want
- 7:02What We Can't Have
- 8:00Different Approach
- 8:57Build or Buy
- 11:47But Java is Slow!
- 13:09JRuby
- 14:11Long, Hard Road
- 16:26Align with JVM
- 17:14Unnecessary Work
- 17:58Method Lookup
- 19:46Constant Lookup
- 20:21Instance Vars
- 20:56Optimizing Ruby
- 22:14JVM 101
- 25:39Dynamic Invocation
- 26:18Constants
- 27:40Instance Variables
- 29:16Benchmarking is Hard
- 32:04JVM Opto 101
- 33:19Inlining
- 34:14Optimistic
- 36:07What Happened?
- 36:30Benchmarking is Not Enough
- 39:44Moral
- 40:03bench_red_black
- 43:44Rails Perf
- 44:17Expand Opto
- 44:47Wacky Stuff
- 45:40The Future








