Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
2
3.6k
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
https://rubykaigi.org/2025
Takashi Kokubun
April 16, 2025
Tweet
Share
More Decks by Takashi Kokubun
See All by Takashi Kokubun
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
11
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
48
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
36
YJIT Makes Rails 1.7x faster / RubyKaigi 2024
k0kubun
7
15k
Ruby JIT Hacking Guide / RubyKaigi 2023
k0kubun
2
10k
YJIT: Dive into Ruby's JIT compiler written in Rust / Rust.Tokyo 2022
k0kubun
2
2.2k
Towards Ruby 4 JIT / RubyKaigi 2022
k0kubun
3
11k
Optimizing Production Performance with MRI JIT / RubyConf 2021
k0kubun
1
500
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
2k
Other Decks in Programming
See All in Programming
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
150
dotfiles 式年遷宮 令和最新版
masawada
1
790
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
260
エディターってAIで操作できるんだぜ
kis9a
0
740
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
170
JETLS.jl ─ A New Language Server for Julia
abap34
1
420
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
190
AIコーディングエージェント(skywork)
kondai24
0
180
AIコーディングエージェント(Gemini)
kondai24
0
240
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
63
35k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Designing for Performance
lara
610
69k
Claude Code のすすめ
schroneko
65
200k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
Chasing Engaging Ingredients in Design
codingconduct
0
71
HDC tutorial
michielstock
0
250
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
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