~/talk

Faster FFI For Ruby

Talkat RubyConf 2026 · 2026-07-14..07-16· [ruby]
slides:none on file

Claims a JIT-driven FFI can beat C by compiling type-specific trampolines and smuggling metadata into native code; implements a pure-Ruby prototype FJIT that generates ARM64 machine code and a toolchain FFX that emits C extensions with JIT hints for Zjit. Benchmarks show FFI ~15M iters/s, C extension ~45M, and FFX+Zjit ~54M iterations per second (SQLite and strlen examples), and the generated wrappers run successfully though the prototype supports only a few types.

AI-written summary · about

  1. 0:00Introduction
  2. 1:58What is FFI
  3. 5:11Use FFI or not
  4. 6:56FFI call overhead
  5. 8:40Ruby C extension calls
  6. 13:38Why FFI is slower
  7. 15:25JIT for FFI slowness
  8. 16:28FJIT and benchmarks
  9. 20:42FJIT limitations
  10. 22:31Built-in faster FFI
  11. 24:15FFX generates C
  12. 26:00JIT hints and smuggling
  13. 28:50ZJIT hints usage
  14. 30:18Benchmark FFX vs FFI vs C
  15. 31:44SQLite example
  16. 32:51Future improvements
  17. 33:11Summary and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.