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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Takashi Kokubun
April 16, 2025
Programming
4.1k
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
420
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
470
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
100
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
110
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
Other Decks in Programming
See All in Programming
Running Swift without an OS
kishikawakatsumi
0
840
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
Making the RBS Parser Faster
soutaro
0
390
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
JOAI2026 1st solution - heron0519 -
heron0519
0
140
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.6k
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
23
13k
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
550
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
370
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
220
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.6k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
BBQ
matthewcrist
89
10k
Tell your own story through comics
letsgokoyo
1
900
Crafting Experiences
bethany
1
110
Balancing Empowerment & Direction
lara
6
1.1k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
A Soul's Torment
seathinner
6
2.7k
Darren the Foodie - Storyboard
khoart
PRO
3
3.3k
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