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
49
SLI/SLO をストリーム アラインドチームに導入した話
tsukasa_oishi
0
140
The Cacher in the Rye
tsukasa_oishi
1
5.7k
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
880
Other Decks in Technology
See All in Technology
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
3
1.2k
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
250
"君は見ているが観察していない"で考えるインシデントマネジメント
grimoh
4
1.2k
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
310
AGIについてChatGPTに聞いてみた
blueb
0
120
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
110
OCI Security サービス 概要
oracle4engineer
PRO
0
6.4k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
110
Going down the RAT hole: Deep dive into the Vuln-derland of APT-class RAT Tools
nttcom
0
420
Lexical Analysis
shigashiyama
1
150
フルカイテン株式会社 採用資料
fullkaiten
0
40k
TypeScript、上達の瞬間
sadnessojisan
43
11k
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Automating Front-end Workflow
addyosmani
1366
200k
Rails Girls Zürich Keynote
gr2m
94
13k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Typedesign – Prime Four
hannesfritz
40
2.4k
Embracing the Ebb and Flow
colly
84
4.5k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
GitHub's CSS Performance
jonrohan
1030
460k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Facilitating Awesome Meetings
lara
50
6.1k
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ͰݟΑ͏