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
4.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
3.7k
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3.2k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
550
ZJIT: The Future of Ruby Performance / San Francisco Ruby Conference 2025
k0kubun
1
140
ZJIT: Building a New JIT Compiler for Ruby / REBASE 2025
k0kubun
0
150
YJIT Makes Rails 1.7x faster / RubyKaigi 2024
k0kubun
7
16k
Ruby JIT Hacking Guide / RubyKaigi 2023
k0kubun
2
11k
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
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
280
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.4k
メールのエイリアス機能を履き違えない
isshinfunada
0
220
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
400
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
650
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
130
今さら聞けない .NET CLI
htkym
0
180
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
330
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
3.4k
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
240
その節約、円になってますか?
isamumumu
1
680
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
420
WENDY [Excerpt]
tessaabrams
11
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
How to Ace a Technical Interview
jacobian
281
24k
The Curious Case for Waylosing
cassininazir
1
450
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.1k
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