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.7k
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
390
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
65
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
70
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
12k
Optimizing Production Performance with MRI JIT / RubyConf 2021
k0kubun
1
520
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
2k
Other Decks in Programming
See All in Programming
AI時代の認知負荷との向き合い方
optfit
0
140
Fluid Templating in TYPO3 14
s2b
0
130
CSC307 Lecture 02
javiergs
PRO
1
770
Data-Centric Kaggle
isax1015
2
760
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
440
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Vibe codingでおすすめの言語と開発手法
uyuki234
0
220
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
190
Featured
See All Featured
A designer walks into a library…
pauljervisheath
210
24k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
310
Paper Plane (Part 1)
katiecoart
PRO
0
4k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
Designing for Timeless Needs
cassininazir
0
130
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
The Pragmatic Product Professional
lauravandoore
37
7.1k
Typedesign – Prime Four
hannesfritz
42
2.9k
Amusing Abliteration
ianozsvald
0
96
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
56
50k
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