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.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
380
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
64
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
65
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
510
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
2k
Other Decks in Programming
See All in Programming
SQL Server 2025 LT
odashinsuke
0
200
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
150
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.2k
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
350
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.7k
rack-attack gemによるリクエスト制限の失敗と学び
pndcat
0
250
SourceGeneratorのススメ
htkym
0
130
Graviton と Nitro と私
maroon1st
0
170
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
250
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
400
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2.3k
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
260
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
84
AI: The stuff that nobody shows you
jnunemaker
PRO
2
200
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
Mobile First: as difficult as doing things right
swwweet
225
10k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Everyday Curiosity
cassininazir
0
120
Tell your own story through comics
letsgokoyo
1
790
The browser strikes back
jonoalderson
0
330
Become a Pro
speakerdeck
PRO
31
5.8k
Facilitating Awesome Meetings
lara
57
6.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