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
200
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
40
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
510
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
2k
Other Decks in Programming
See All in Programming
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
240
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
420
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
260
開発に寄りそう自動テストの実現
goyoki
2
1.3k
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
ゲームの物理 剛体編
fadis
0
360
AIコーディングエージェント(Manus)
kondai24
0
200
これならできる!個人開発のすゝめ
tinykitten
PRO
0
120
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
420
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
100
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
40
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
250
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
400
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
320
Technical Leadership for Architectural Decision Making
baasie
0
180
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
64
35k
It's Worth the Effort
3n
187
29k
Into the Great Unknown - MozCon
thekraken
40
2.2k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
Practical Orchestrator
shlominoach
190
11k
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Rails Girls Zürich Keynote
gr2m
95
14k
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