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
3k
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
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
1
2.1k
Towards Ruby 4 JIT / RubyKaigi 2022
k0kubun
3
11k
Optimizing Production Performance with MRI JIT / RubyConf 2021
k0kubun
1
470
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
1.9k
数時間かかる週一リリースを毎日何度も爆速でできるようにするまで / CI/CD Conference 2021
k0kubun
21
14k
Ruby 3 JIT's roadmap / RubyConf China 2020
k0kubun
0
820
Ruby 3.0 JIT on Rails
k0kubun
9
9.3k
Other Decks in Programming
See All in Programming
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
280
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
「テストは愚直&&網羅的に書くほどよい」という誤解 / Test Smarter, Not Harder
munetoshi
0
150
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
610
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
180
AIともっと楽するE2Eテスト
myohei
1
390
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
760
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
160
チームのテスト力を総合的に鍛えて品質、スピード、レジリエンスを共立させる/Testing approach that improves quality, speed, and resilience
goyoki
4
740
Hack Claude Code with Claude Code
choplin
3
1k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
440
Featured
See All Featured
How GitHub (no longer) Works
holman
314
140k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
680
The Invisible Side of Design
smashingmag
301
51k
Designing for Performance
lara
610
69k
The World Runs on Bad Software
bkeepers
PRO
69
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
GitHub's CSS Performance
jonrohan
1031
460k
A better future with KSS
kneath
239
17k
Producing Creativity
orderedlist
PRO
346
40k
RailsConf 2023
tenderlove
30
1.1k
Faster Mobile Websites
deanohume
307
31k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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