Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Deoptimization: How YJIT Speeds Up Ruby by Slow...
Search
Takashi Kokubun
April 16, 2025
Programming
4.7k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
https://rubykaigi.org/2025
Takashi Kokubun
April 16, 2025
More Decks by Takashi Kokubun
See All by Takashi Kokubun
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
3.7k
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3.2k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
560
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
150
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
160
YJIT Makes Rails 1.7x faster / RubyKaigi 2024
k0kubun
7
16k
Ruby JIT Hacking Guide / RubyKaigi 2023
k0kubun
2
11k
YJIT: Dive into Ruby's JIT compiler written in Rust / Rust.Tokyo 2022
k0kubun
2
2.4k
Towards Ruby 4 JIT / RubyKaigi 2022
k0kubun
3
12k
Other Decks in Programming
See All in Programming
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
280
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.8k
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
190
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
390
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
570
Deep dive into the select statement (GopherCon UK)
jespino
0
150
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.2k
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
640
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
310
T3DD26: From RAGs to Riches
martinhelmich
0
110
プロポーザルを書いてもらう
pvcresin
0
590
Featured
See All Featured
AI: The stuff that nobody shows you
jnunemaker
PRO
9
950
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
The Invisible Side of Design
smashingmag
301
52k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Practical Orchestrator
shlominoach
191
12k
Code Review Best Practice
trishagee
74
20k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
510
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
310
Transcript
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down @k0kubun
/ RubyKaigi 2025
@k0kubun
@k0kubun Z
None
We’re hiring https://candidate.shopify.com/form/ruby-kaigi-2025
None
YJIT
None
https://railsatscale.com/2025-01-10-yjit-3-4-even-faster-and-more-memory-ef fi cient/
None
None
Deoptimization
None
Deoptimization What if you can “slow down” Ruby at any
time? You can speculatively optimize Ruby and invalidate it later
Playing with Deoptimization Build Ruby with: ./con fi gure --enable-yjit=dev
Run Ruby with: ruby --yjit-call-threshold=1 --yjit-dump-disasm
Playing with Deoptimization
None
YJIT Deoptimization
Code Patching
None
None
None
None
Rewrite
Rewrite Jump
Global Invalidation
None
None
None
Ruby 3.4’s New YJIT Deoptimization
Invalidation on Escaped Locals
?
None
None
Invalidation on Singleton Classes
None
None
None
None
Singleton Class Invalidation
Lazy Frame Push
None
None
None
Lazy Frame Push
None
None
None
None
YJIT-only Ruby Methods
Array#each
None
None
None
None
None
None
None
Primitive.attr! :c_trace
Conclusion Deoptimization enables speculative optimizations with lazy invalidation Ruby 3.4
YJIT optimizes method calls and local variables using deoptimization