Ruby’s C Extension Problem and How We're Solving It
summary
Claim: JRuby+Truffle runs C extensions by interpreting LLVM IR for C extensions and merging those IR trees with Ruby ASTs so the Graal JIT can optimize across language boundaries. Results show native C gems become faster overall — examples: up to three times faster than MRI with the same C extensions, ~9× on Optcarrot and 10–20× on some benchmarks — while hitting ~99% language spec coverage and running Rails core pieces. Limits: needs C source, cannot hand out raw Ruby pointers, OpenSSL and many gems remain work in progress.
AI-written summary · about
chapters (11)
- 0:00Start
- 1:40C extensions -the original solution for performance
- 5:25String pointers
- 7:17Data fields
- 9:04The black box
- 10:13Denial
- 11:10Bargaining
- 12:56Depression
- 13:22Acceptance
- 20:30Imaginary strings
- 27:05Classic research benchmarks - 10-20% faster than MRI








