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
Takashi Kokubun
April 16, 2025
Programming
4.2k
2
Share
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
https://rubykaigi.org/2025
Takashi Kokubun
April 16, 2025
More Decks by Takashi Kokubun
See All by Takashi Kokubun
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
3.4k
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3.1k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
510
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
120
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
130
YJIT Makes Rails 1.7x faster / RubyKaigi 2024
k0kubun
7
16k
Ruby JIT Hacking Guide / RubyKaigi 2023
k0kubun
2
11k
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
Other Decks in Programming
See All in Programming
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.2k
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1.1k
Inspired By RubyKaigi (EN)
atzzcokek
0
500
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
17
5.5k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
330
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
550
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
140
GitHub Copilot CLIのいいところ
htkym
2
1.2k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
120
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
690
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
230
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
350
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
570
Are puppies a ranking factor?
jonoalderson
1
3.5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
160
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Speed Design
sergeychernyshev
33
1.8k
Agile that works and the tools we love
rasmusluckow
331
21k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
600
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
The untapped power of vector embeddings
frankvandijk
2
1.7k
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