~/talk

The secret power of Ruby 2.6: JIT

Talkat RubyConf 2018 · 2018-11-28..11-30· [ruby]
slides:none on file

Ruby 2.6’s MJIT is usable with --jit (or RUBYOPT="--jit") and can speed some workloads ~2.5× (Optcarrot to ~60 FPS) but also makes Rails/Sidekiq slower when it compiles many methods (reports around 10,000). MJIT spawns GCC worker processes, emits C, dlopen’s multi‑megabyte objects, and incurs 50–200 ms compile latency; default jit-max-cache 1000 triggers a costly compaction step. TracePoint disables JIT, and GC/waitpid contention can stall the main thread. Mitigations: reduce jit-max-cache, use JIT compaction/inline‑method patches, profile with benchmark_driver.

AI-written summary · about

  1. 0:00Start
  2. 2:28History of Ruby implementation
  3. 4:33Let's benchmark Ruby 2.6 JIT
  4. 6:06How about other benchmarks?
  5. 6:29Today's topic JIT performance characteristics
  6. 7:02When there are many JIT-ed methods
  7. 7:54JIT by C compiler & dynamic loading
  8. 10:55JIT compaction
  9. 11:58CPU/memory resources for C compiler
  10. 12:28Locks on GC, waitpid, ...
  11. 15:581. Almost all methods
  12. 17:192. Basic operators on core classes
  13. 18:42Calling Ruby method
  14. 21:15Instance variable access
  15. 29:33Create a benchmark for Ruby 3x3?
~/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.