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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Takashi Kokubun
April 16, 2025
Programming
3.9k
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
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
3
2.7k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
450
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
92
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
93
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
Other Decks in Programming
See All in Programming
Coding as Prompting Since 2025
ragingwind
0
620
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
100
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
160
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
320
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
200
Nuxt Server Components
wattanx
0
230
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
770
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
530
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
130
Tamach-sre-3_ANDPAD-shimaison93
mane12yurks38
0
230
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
160
The Cult of Friendly URLs
andyhume
79
6.8k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
ラッコキーワード サービス紹介資料
rakko
1
2.8M
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
440
Designing Experiences People Love
moore
143
24k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
420
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
160
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.5k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
250
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
280
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
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