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
Aloha Ruby Conf 2012: Message in a Bottle
Search
Konstantin Haase
October 10, 2012
5
2.1k
Aloha Ruby Conf 2012: Message in a Bottle
Konstantin Haase
October 10, 2012
Tweet
Share
More Decks by Konstantin Haase
See All by Konstantin Haase
RubyConf Philippines 2017: Magenta is a Lie
rkh
0
180
How We Replaced Salary Negotiations with a Sinatra App
rkh
17
4k
HTTP (RubyMonsters Edition)
rkh
5
1k
GCRC 2015: Abstract Thoughts on Abstract Things
rkh
1
330
Frozen Rails: Magenta - The Art Of Abstraction
rkh
3
280
RedDotRubyConf 2014: Magenta is a Lie - and other tales of abstraction
rkh
0
800
Ancient City Ruby: Hack me, if you can!
rkh
2
390
Boston I/O: Continuous Integration
rkh
3
300
Steel City Ruby: Architecting Chaos
rkh
4
870
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
327
21k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
A Tale of Four Properties
chriscoyier
156
23k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Automating Front-end Workflow
addyosmani
1366
200k
Become a Pro
speakerdeck
PRO
25
5k
For a Future-Friendly Web
brad_frost
175
9.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Transcript
MESSAGE IN A BOTTLE Konstantin Haase Aloha Ruby Conference October
8, 2012
Ruby 1.8 is slow because it's interpreted.
Surprise! Ruby 1.9 is interpreted, too.
THANKS
@konstantinhaase (I’m sorry about that) rkh on github
None
None
None
None
None
None
WWAPD
Ruby
Internals
Performance
None
RubyMotion rupypy
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
Module MethodTable Bucket CompiledCode
None
None
None
None
InlineCache MachineCode CompiledCode initial_backend execute_backend cache_[cTrackedICHits] execute empty_cache ...
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
Reducing CPU instructions Reducing jumps Not breaking late binding
caching inlining JITing guards
FAST LOOKUP FAST EXECUTION
THANKS