Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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.5k
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 Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
43
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
34
YJIT Makes Rails 1.7x faster / RubyKaigi 2024
k0kubun
7
14k
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
数時間かかる週一リリースを毎日何度も爆速でできるようにするまで / CI/CD Conference 2021
k0kubun
21
14k
Other Decks in Programming
See All in Programming
エディターってAIで操作できるんだぜ
kis9a
0
710
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
340
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
STYLE
koic
0
160
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
500
認証・認可の基本を学ぼう前編
kouyuume
0
190
チームをチームにするEM
hitode909
0
300
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
170
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
110
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
認証・認可の基本を学ぼう後編
kouyuume
0
180
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
600
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
76
5.2k
Site-Speed That Sticks
csswizardry
13
990
KATA
mclloyd
PRO
32
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
A Tale of Four Properties
chriscoyier
162
23k
Six Lessons from altMBA
skipperchong
29
4.1k
Navigating Team Friction
lara
191
16k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Raft: Consensus for Rubyists
vanstee
141
7.2k
Balancing Empowerment & Direction
lara
5
790
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
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