~/talk

A Faster FFI

Talkat RubyKaigi 2026 · 2026-04-22..04-24· [ruby]
slides:none on file

Claims a JIT-backed FFI pipeline that beats handwritten C: a Ruby-side translator generates C extensions with tiny trampolines that smuggle type metadata (magic marker FF50) so ZJIT emits an ffi_call instruction instead of a generic C dispatch. Prototype tools include Fjit, FFX, fiddle, fisk, jit-buffer and hacks; RJIT dependency is a drawback. Benchmarks: libffi ~15M iters/sec, native C ~45M, FFX-trampoline ~54M; a SQLite extension runs ~1.4× faster with ZJIT+FFX.

AI-written summary · about

  1. 0:00Introduction
  2. 1:15What is FFI
  3. 3:58Why use FFI
  4. 7:10How C extensions work
  5. 10:35Why FFI is slow
  6. 12:06Faster FFI with JIT
  7. 16:50Problems with Fjit
  8. 17:54ZJIT API and FFX
  9. 20:30Conveying type info
  10. 24:54ZJIT using metadata
  11. 27:12Benchmark results
  12. 28:24SQLite extension demo
  13. 30:34Ruby faster than C
  14. 31:00Future work
~/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.