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
JITをたどるとそこはYARVの中
Search
Tsukasa OISHI
June 21, 2019
Technology
0
550
JITをたどるとそこはYARVの中
Tsukasa OISHI
June 21, 2019
Tweet
Share
More Decks by Tsukasa OISHI
See All by Tsukasa OISHI
怖くないメモリ肥大化
tsukasa_oishi
1
61
SLI/SLO をストリーム アラインドチームに導入した話
tsukasa_oishi
0
150
The Cacher in the Rye
tsukasa_oishi
1
5.8k
ISeqで遊ぼう
tsukasa_oishi
0
5k
Rubyを30倍速くした話
tsukasa_oishi
0
1.1k
はてブ砲をくらったときのお話
tsukasa_oishi
0
2k
食べログで動いている自作ライブラリのお話
tsukasa_oishi
0
300
奥さんとプログラミングを両立させる方法
tsukasa_oishi
0
52
MiyazakiResistanceを作ってみたよ
tsukasa_oishi
0
910
Other Decks in Technology
See All in Technology
0→1事業こそPMは営業すべし / pmconf #落選お披露目 / PM should do sales in zero to one
roki_n_
PRO
1
1.5k
実践! ソフトウェアエンジニアリングの価値の計測 ── Effort、Output、Outcome、Impact
nomuson
0
2.1k
RubyでKubernetesプログラミング
sat
PRO
4
160
Reactフレームワークプロダクトを モバイルアプリにして、もっと便利に。 ユーザに価値を届けよう。/React Framework with Capacitor
rdlabo
0
130
商品レコメンドでのexplicit negative feedbackの活用
alpicola
2
370
メールヘッダーを見てみよう
hinono
0
110
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!事例のご紹介+座学②
siyuanzh09
0
110
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
360
完全自律型AIエージェントとAgentic Workflow〜ワークフロー構築という現実解
pharma_x_tech
0
350
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
120
生成AI × 旅行 LLMを活用した旅行プラン生成・チャットボット
kominet_ava
0
160
Amazon Route 53, 待ちに待った TLSAレコードのサポート開始
kenichinakamura
0
170
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
Music & Morning Musume
bryan
46
6.3k
GraphQLとの向き合い方2022年版
quramy
44
13k
4 Signs Your Business is Dying
shpigford
182
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Gamification - CAS2011
davidbonilla
80
5.1k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
Navigating Team Friction
lara
183
15k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
+*5ΛͨͲΔͱ ͦ͜:"37ͷத
͓͓͍͔ͭ͠͞
ruby --jit
def fib(num) if num < 2 num else fib(num -
2) + fib(num - 1) end end
fib(35)
$ time ruby fib.rb real 0m1.636s user 0m1.520s sys 0m0.050s
$ time ruby —jit fib.rb real 0m0.786s user 0m1.280s sys
0m0.050s
Ͳ͏ͯ͘͠ͳΔͷʁ
ϝιουͷόΠτίʔυΛ $ʹมͯ͠ίϯύΠϧ͠ ͯTPϑΝΠϧΛ࡞ͯ͠ EMTZNͯ͠खʹೖΕͨؔ ϙΠϯλΛͬͯϚγϯޠ
1IPUPCZ"MFYJT#SPXOPO6OTQMBTI ͍ͭ͜ɺͳʹݴͬͯΜͩʁ
7.Α͘Βͳ͍͚Ͳ ͍ͬͯΔΑ͏ͳإ ͠ͱ͜͏ 1IPUPCZ$BMMVN8BMFPO6OTQMBTI
None
:"37 3VCZ7. ΛΕ+*5 Θ͔Δ ͣ
͋ͱͰ3VCZ,BJHJ ͷ+*5ͷηογϣϯ͕ Θ͔ΔΑ͏ʹͳΓ·͢ ͣ
ίϯϐϡʔλ
None
ిࢠܭࢉػ
2 * 3 + 4 * 5
2 3 * 4 5 * +
2 3 * 4 5 * + ελοΫ
2 3 * 4 5 * + ελοΫ 2 PUSH
2
2 3 * 4 5 * + ελοΫ 2 3
PUSH 2 PUSH 3
2 3 * 4 5 * + ελοΫ 6 PUSH
2 PUSH 3 MUL
2 3 * 4 5 * + ελοΫ 6 4
PUSH 2 PUSH 3 MUL PUSH 4
2 3 * 4 5 * + ελοΫ 6 4
5 PUSH 2 PUSH 3 MUL PUSH 4 PUSH 5
2 3 * 4 5 * + ελοΫ 6 20
PUSH 2 PUSH 3 MUL PUSH 4 PUSH 5 MUL
2 3 * 4 5 * + ελοΫ 26 PUSH
2 PUSH 3 MUL PUSH 4 PUSH 5 MUL ADD
3VCZ͚͕ͩಈ͘ઐ༻ͷίϯϐϡʔλ
2 * 3 + 4 * 5
2 3 * 4 5 * +
2 3 * 4 5 * + ελοΫ
2 3 * 4 5 * + ελοΫ 2 putobject
2
2 3 * 4 5 * + ελοΫ 2 3
putobject 2 putobject 3
2 3 * 4 5 * + ελοΫ 6 putobject
2 putobject 3 opt_mult mid:*, argc:1
2 3 * 4 5 * + ελοΫ 6 4
putobject 2 putobject 3 opt_mult mid:*, argc:1 putobject 4
2 3 * 4 5 * + ελοΫ 6 4
5 putobject 2 putobject 3 opt_mult mid:*, argc:1 putobject 4 putobject 5
2 3 * 4 5 * + ελοΫ 6 20
putobject 2 putobject 3 opt_mult mid:*, argc:1 putobject 4 putobject 5 opt_mult mid:*, argc:1
2 3 * 4 5 * + ελοΫ 26 putobject
2 putobject 3 opt_mult mid:*, argc:1 putobject 4 putobject 5 opt_mult mid:*, argc:1 opt_plus mid:+, argc:1
2 3 * 4 5 * + ελοΫ 26 putobject
2 putobject 3 opt_mult mid:*, argc:1 putobject 4 putobject 5 opt_mult mid:*, argc:1 opt_plus mid:+, argc:1 όΠτίʔυ
ϝιουͷόΠτίʔυΛ $ʹมͯ͠ίϯύΠϧ͠ ͯTPϑΝΠϧΛ࡞ͯ͠ EMTZNͯ͠खʹೖΕͨؔ ϙΠϯλΛͬͯϚγϯޠ
putobject 2 putobject 3 opt_mult mid:*, argc:1 putobject 4 putobject
5 opt_mult mid:*, argc:1 opt_plus mid:+, argc:1 όΠτίʔυ :"37 3VCZ7.
putobject 2 putobject 3 opt_mult mid:*, argc:1 putobject 4 putobject
5 opt_mult mid:*, argc:1 opt_plus mid:+, argc:1 όΠτίʔυ :"37 3VCZ7.
putobject 2 putobject 3 opt_mult mid:*, argc:1 putobject 4 putobject
5 opt_mult mid:*, argc:1 opt_plus mid:+, argc:1 όΠτίʔυ :"37 3VCZ7. ϋʔυΣΞͰͳ͘ ιϑτΣΞͰԾతʹ࡞ΒΕͨܭࢉػ
+VTU*O5JNF $PNQJMFS
ͳΜͷͨΊʹʁ 1IPUPCZ+F[5JNNTPO6OTQMBTI
ͬͱ͘
putobject 2 putobject 3 opt_mult mid:*, argc:1 :"37 3VCZ7.
putobject 2 putobject 3 opt_mult mid:*, argc:1 :"37 3VCZ7. όΠτίʔυΛCʹมͯ͠
ίϯύΠϧͯ͠࡞ͨ͠ .soϑΝΠϧ
putobject 2 putobject 3 opt_mult mid:*, argc:1 :"37 3VCZ7. όΠτίʔυΛCʹมͯ͠
ίϯύΠϧͯ͠࡞ͨ͠ .soϑΝΠϧ
3VCZͷ+*5
ݺͼग़͠ճͷ ଟ͍ϝιουΛ +*5͢Δ
+*5ͯ͠ϦϯΫ ͢Δϝιου ʹ্ݶ͕͋Δ
3VCZͷ+*5
--jit-max-cache=num Max number of methods to be JIT-ed in a
cache (default: 1000) --jit-min-calls=num Number of calls to trigger JIT (for testing, default: 5)
3VCZQSFWJFX ͷ+*5
--jit-max-cache=num Max number of methods to be JIT-ed in a
cache (default: 100) --jit-min-calls=num Number of calls to trigger JIT (for testing, default: 10000)
3VCZ,BJHJͷ+*5ͷ ηογϣϯΛ:PV5VCFͰݟΑ͏