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
52
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
1.9k
食べログで動いている自作ライブラリのお話
tsukasa_oishi
0
290
奥さんとプログラミングを両立させる方法
tsukasa_oishi
0
50
MiyazakiResistanceを作ってみたよ
tsukasa_oishi
0
890
Other Decks in Technology
See All in Technology
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
Qiita埋め込み用スライド
naoki_0531
0
4.7k
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
MLOps の現場から
asei
6
640
5分でわかるDuckDB
chanyou0311
10
3.2k
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
210
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
230
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
380
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
520
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Designing for Performance
lara
604
68k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Fireside Chat
paigeccino
34
3.1k
The Invisible Side of Design
smashingmag
298
50k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Code Review Best Practice
trishagee
65
17k
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ͰݟΑ͏