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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Takashi Kokubun
April 16, 2025
Programming
2
3.8k
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
1
430
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
81
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
82
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.3k
Towards Ruby 4 JIT / RubyKaigi 2022
k0kubun
3
12k
Optimizing Production Performance with MRI JIT / RubyConf 2021
k0kubun
1
530
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
2k
Other Decks in Programming
See All in Programming
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
170
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
530
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
310
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
150
AHC061解説
shun_pi
0
320
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.2k
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
210
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
200
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
330
Fundamentals of Software Engineering In the Age of AI
therealdanvega
0
150
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
180
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
140
Facilitating Awesome Meetings
lara
57
6.8k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
94
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
140
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
230
The Mindset for Success: Future Career Progression
greggifford
PRO
0
270
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
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