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
2
3.9k
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
440
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
88
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
88
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
Optimizing Production Performance with MRI JIT / RubyConf 2021
k0kubun
1
530
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
2k
Other Decks in Programming
See All in Programming
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
470
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
180
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
240
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
300
Nuxt Server Components
wattanx
0
100
The free-lunch guide to idea circularity
hollycummins
0
340
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
160
[SF Ruby Feb'26] The Silicon Heel
palkan
0
120
Feature Toggle は捨てやすく使おう
gennei
0
320
Pythonデータ分析コトハジメinFukuoka
kanan
0
100
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
120
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
390
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
300
The SEO Collaboration Effect
kristinabergwall1
0
400
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Technical Leadership for Architectural Decision Making
baasie
3
300
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
150
Agile that works and the tools we love
rasmusluckow
331
21k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
230
Visualization
eitanlees
150
17k
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