Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Ruby Lugdunum 2012: Message in a Bottle
Konstantin Haase
June 23, 2012
Technology
2
510
Ruby Lugdunum 2012: Message in a Bottle
Konstantin Haase
June 23, 2012
Tweet
Share
More Decks by Konstantin Haase
See All by Konstantin Haase
rkh
0
150
rkh
17
3.2k
rkh
5
570
rkh
1
280
rkh
3
220
rkh
0
400
rkh
2
320
rkh
3
230
rkh
4
540
Other Decks in Technology
See All in Technology
kanaugust
PRO
0
110
tdys13
5
3.5k
clustervr
0
160
papix
0
160
viva_tweet_x
5
2.7k
ymas0315
0
180
kraj
0
5.4k
ganariya
0
240
sasakendayo
2
440
sakon310
4
4.3k
layerx
1
940
shirayanagiryuji
0
2.2k
Featured
See All Featured
qrush
285
18k
ufuk
56
5.4k
brettharned
93
3k
frogandcode
127
20k
pedronauck
652
110k
mthomps
39
2.3k
chrislema
173
14k
kastner
54
1.9k
paulrobertlloyd
71
3.6k
philhawksworth
190
17k
yeseniaperezcruz
302
31k
chriscoyier
780
240k
Transcript
MESSAGE IN A BOTTLE Konstantin Haase Ruby Lugdunum June 23,
2012
@konstantinhaase (I’m sorry about that) rkh on github
Sinatra Rack, Tilt, Rubinius, ...
None
None
None
None
None
None
Ruby 1.8 is slow because it's interpreted.
Surprise! Ruby 1.9 is interpreted, too.
THANKS
Ruby
Internals
Performance
None
RubyMotion
WHAT WE’LL LOOK INTO MRI: method dispatch and execution Rubinius:
inline caches and JIT JRuby: invokedynamic
None
THEY JUST LOVE BYTECODE
None
MRI
Rubinius
JRuby (JVM 1.6)
None
Source Code Parser Parse Tree Interpreter Bytecode Compiler Bytecode Interpreter
JIT Machine Code CPU VM
THE PLAN Find Method Execute Method
Performance
HOW TO SPEED UP? Find Method Faster Execute Method Faster
FIND FASTER Inline Cache (aka Call/ Send Site Cache) Lookup
Cache Inlining
EXECUTE FASTER Reduce operations Just-in-time compilation Speed up search
None
rb_method_entry rb_method_entry_without_cache search_method
None
None
None
None
None
None
None
None
None
None
None
None
None
SPECIALIZED METHODS cached bytecode code with breakpoints specialized for arguments
JITed code
None
None
None
None
None
None
None
Process invokedynamic JVM method bootstrap guard fallback
None
THANKS