SlideShare a Scribd company logo
1 of 59
Download to read offline
Matthew Gaudet, February 4th, 2017
Highly Surmountable
Challenges in Ruby+OMR JIT
Compilation
What’s Ruby+OMR again?
An Open Source Toolkit for Language
Runtime Technologies.
Garbage
Collector
JIT Compiler
Monitoring
Porting Library
…More!
Goal: Compatibility!
Integrate vs. Replace
+
8
Status Update: 13 Months later
10
11
No JIT….
13
14
Today:
 Branch ruby_2_4_omr is current default.
– Based of ruby_2_4 tag
 JIT Compiler Hooked up and running Travis tests for OS/X and Linux
– Known issues in make test-all
– Passing make test with count=0
 Populated and tagged Issue Tracker
 Performance: Less specialization to micro benchmarks, means lower
seeming performance.
– Better software engineering 
https://github.com/rubyomr-preview/ruby/issues/
JIT integration
 Functional Correctness has been primary objective
– Aiming for pass of test suite at all optimization levels.
–No restrictions on native code used by extension modules
 Have added some optimizations, but haven’t done much in the way of
tuning.
 Simple compilation control
Our Goal:
YES
Be Part of Delivering 3x3
Why?
 We think Ruby could really benefit from having a JIT
compiler.
 Lots of pre-built JIT compiler technology in OMR, with
potential for exploitation in Ruby.
 What’s in it for us? Validation of the OMR approach
–Community improvement: Having multiple consumers
helps us make it better for everyone!
https://twitter.com/ChrisGSeaton/status/811303853488488448
Competition and Collaboration
 Having multiple JITs for CRuby could be a really good thing!
 Share the load of creating interface and infrastructure that all
JITs for CRuby can rely on.
 Competition helps push things forward
 Collaboration helps solve hard problems!
21
22 https://twitter.com/ChrisGSeaton/status/811332662350794752
23
Effort!
Results!
Community Challenges!
https://twitter.com/tenderlove/status/765288
21993188147226
Make Tradeoffs that are Right for the Ruby Community
JIT Compilation:
 Trade startup speed for peak speed.
 Trade footprint for speed.
What do we prioritize?
Time to First Request?
Time to Peak
Performance?
Peak Performance?
100
64 69
36
25 30 25 26 25 26 25
1 2 3 4 5 6 7 8 9 10 11
Time per Iteration (s)
Prioritization will be driven by
benchmarks from the community.
1. Some CPU intensive applications: OptCarrot
2. Some memory intensive application:
3. A startup benchmark: time ruby -e “def f; ‘100’; end; puts f”?
4. Some web application framework benchmark(s)?
http://rubykaigi.org/2016/presentations/MattStudies.html
Benchmarks to aim for?
http://engineering.appfolio.com/appfolio-engineering/2016/12/8/benchmarking-rails
Information Challenges
MRI
Garbage
Collector
Ruby IL
Generator Optimizer Code
Generator
Runtime Code Cache
YARV
Interpreter
JIT VM Symbiosis
VMJIT
Performance
Information
JIT ↔ VM Interface
Infrequent Event Notification
Operations such as
 Basic Operation Redefinition
 Constant Modification
 Class Hierarchy changes.
Unlocks:
–More aggressive specialization, class hierarchy
optimization. Don’t create code for things that haven’t
happened yet!
Stack Peeking Notification
 A hook that fires when some piece of code wants to look at a
stack frame – Give the JIT compiler a chance to materialize
what it should have looked like.
 Unlocks
–On Stack Replacement: Don’t Execute Code for Things
that might happen!
Basic Block Frequencies
How many times has this basic block been executed?
Unlocks:
Better Optimization: Don’t spend time compiling
on things that won’t get executed!
?
Type Profiling
What types have we seen for this value?
Unlocks:
Speculation and Specialization: Generate code for
the cases we think will happen!
Horizon Challenges
Much of MRI’s core functionality is written in C!
A problem for the optimization horizon!
Optimization Horizon Solutions?
 Rewrite all of core in Ruby.
 ‘Lift the Core’
40
Optimization Horizon Solutions?
Incremental Ruby-fication:
 More promising… and easy to get started on in Ruby!
 Convert prelude.rb to a ‘prelude’ directory, where Ruby implementations
live.
– Startup concerns (parse overheads) – can be mitigated with YARV
bytecode serialization.
– Longer term: JIT AOT Compilation maybe!
41
Optimization Challenges
An admission:
Testing Challenges
JIT Testing is Hard!
Normal Tests
 Finish quickly
 Coverage with minimal repetition.
 Local reasoning / isolation
 No special command lines
Compiler Stress Tests
 Need to run code multiple times!
– Allow the JIT to kick in, profile data
to be collected, and consumed
 Potentially require global
reasoning.
 Run in multiple VM instances
under different options.
Writing test cases that can effectively
stress the JIT compiler is an art
JIT Testing is Hard!
Other problems:
 Isolating test cases from each
other
 Time accuracy trade off
 Coverage
All these problems of JIT
testing will also be equally
true when running a
gem’s test suite with a
JIT...
My Personal Ruby Hero
Patched ruby/spec to
allow it to work with
repetition
Great win for JIT testing!
Engineering Challenges
Keeping up with the firehose?
How do we keep up to date with the Ruby core?
Some is good software engineering… callback generation was
done precisely to address this concern. But more still needed!
The JIT Needs some cleanup 
 Callback Generator Ruby code isn’t very good!
–https://github.com/rubyomr-preview/ruby/issues/74
 Great task for someone good at writing Ruby!
 The makefiles need love
– https://github.com/rubyomr-preview/ruby/issues/8
OMR Challenges
OMR is evolving!
We’ve only been open source for 4.5 months!
Still working on improving our interfaces, our
integration story.
Need to build out a community! This is where you
can help!
Mentorship
I’m committed to helping anyone who
wants to contribute to Ruby+OMR
get up and running.
I’ll write documentation
for things that are
unclear
I’ll answer email!
I’ll help guide
implementationI’ll be on slack!
I’ll schedule a video chat
with you!
Ruby+OMR needs community
interest to survive!
My To-Do List!
1. Make My Mentorship Commitment Clear!
2. I need to start collecting feedback from ruby-core
on what we would need to do to get community
members interested.
3. I need to start demonstrating the kinds of VM
changes a JIT will need.
The Audience To-Do List!
1. Give Ruby+OMR a try
2. Open Issues!
3. Ask about helping! Little things are equally
appreciated!
My thoughts on hitting 3x3:
57
The Work Ahead!
JIT Work VM Work
The VM Work I
hope can be shared
among competition!
Thank you so much!
Acknowledgements
 https://en.wikipedia.org/wiki/Foundation_%28engineering%29#/media/File:Concrete_cellar_
10007.JPG
http://emojipedia.org/mozilla/firefox-os-
2.5/confused-face/

More Related Content

What's hot

mRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentmRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System Development
Kazuhiro Koga 古賀一博
 
Composing Project Dependencies
Composing Project DependenciesComposing Project Dependencies
Composing Project Dependencies
Derek Gallo
 
Northwest Python Day 2009
Northwest Python Day 2009Northwest Python Day 2009
Northwest Python Day 2009
Ted Leung
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
oscon2007
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
VincitOy
 

What's hot (20)

Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
 
Not your fathers language c++
Not your fathers language c++Not your fathers language c++
Not your fathers language c++
 
Trunk-Based Development and Toggling
Trunk-Based Development and TogglingTrunk-Based Development and Toggling
Trunk-Based Development and Toggling
 
It's a Jungle Out There – IoT and MRuby
It's a Jungle Out There – IoT and MRubyIt's a Jungle Out There – IoT and MRuby
It's a Jungle Out There – IoT and MRuby
 
JIT Compiler
JIT CompilerJIT Compiler
JIT Compiler
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
 
mRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentmRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System Development
 
Functional solid
Functional solidFunctional solid
Functional solid
 
Functional Solid, Aleksandr Sugak
Functional Solid, Aleksandr SugakFunctional Solid, Aleksandr Sugak
Functional Solid, Aleksandr Sugak
 
GraalVM: Run Programs Faster Everywhere
GraalVM: Run Programs Faster EverywhereGraalVM: Run Programs Faster Everywhere
GraalVM: Run Programs Faster Everywhere
 
Os Rego
Os RegoOs Rego
Os Rego
 
Distributed Version Control Systems
Distributed Version Control SystemsDistributed Version Control Systems
Distributed Version Control Systems
 
GraalVM
GraalVMGraalVM
GraalVM
 
Composing Project Dependencies
Composing Project DependenciesComposing Project Dependencies
Composing Project Dependencies
 
Northwest Python Day 2009
Northwest Python Day 2009Northwest Python Day 2009
Northwest Python Day 2009
 
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
Software Craftsmanship for DevOps professionals - Umesh Kumar / Murughan Pala...
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
 
From java-to-ruby-book-summary
From java-to-ruby-book-summaryFrom java-to-ruby-book-summary
From java-to-ruby-book-summary
 

Viewers also liked

Parallel computing
Parallel computingParallel computing
Parallel computing
virend111
 
0 introduction to computer architecture
0 introduction to computer architecture0 introduction to computer architecture
0 introduction to computer architecture
aamc1100
 

Viewers also liked (20)

Parallel processing
Parallel processingParallel processing
Parallel processing
 
FOSDEM2016 - Ruby and OMR
FOSDEM2016 - Ruby and OMRFOSDEM2016 - Ruby and OMR
FOSDEM2016 - Ruby and OMR
 
Higher nab preparation
Higher nab preparationHigher nab preparation
Higher nab preparation
 
Introduction To Parallel Computing
Introduction To Parallel ComputingIntroduction To Parallel Computing
Introduction To Parallel Computing
 
Introduction to Parallel Computing
Introduction to Parallel ComputingIntroduction to Parallel Computing
Introduction to Parallel Computing
 
Experiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRubyExperiments in Sharing Java VM Technology with CRuby
Experiments in Sharing Java VM Technology with CRuby
 
network ram parallel computing
network ram parallel computingnetwork ram parallel computing
network ram parallel computing
 
Parallel computing(1)
Parallel computing(1)Parallel computing(1)
Parallel computing(1)
 
Introduction to parallel_computing
Introduction to parallel_computingIntroduction to parallel_computing
Introduction to parallel_computing
 
VLSI Design(Fabrication)
VLSI Design(Fabrication)VLSI Design(Fabrication)
VLSI Design(Fabrication)
 
Parallel computing
Parallel computingParallel computing
Parallel computing
 
Parallel computing(2)
Parallel computing(2)Parallel computing(2)
Parallel computing(2)
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
0 introduction to computer architecture
0 introduction to computer architecture0 introduction to computer architecture
0 introduction to computer architecture
 
Parallel Computing
Parallel ComputingParallel Computing
Parallel Computing
 
Applications of paralleL processing
Applications of paralleL processingApplications of paralleL processing
Applications of paralleL processing
 
Parallel processing Concepts
Parallel processing ConceptsParallel processing Concepts
Parallel processing Concepts
 
Introduction to parallel processing
Introduction to parallel processingIntroduction to parallel processing
Introduction to parallel processing
 
Parallel computing
Parallel computingParallel computing
Parallel computing
 

Similar to Highly Surmountable Challenges in Ruby+OMR JIT Compilation

Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索
Mu Chun Wang
 

Similar to Highly Surmountable Challenges in Ruby+OMR JIT Compilation (20)

Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索
 
JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?
 
Besut Kode Challenge 1
Besut Kode Challenge 1Besut Kode Challenge 1
Besut Kode Challenge 1
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Ruby JIT Compilation - Mykhail Bortnyk
Ruby JIT Compilation - Mykhail Bortnyk Ruby JIT Compilation - Mykhail Bortnyk
Ruby JIT Compilation - Mykhail Bortnyk
 
Ruby JIT Compilation
Ruby JIT CompilationRuby JIT Compilation
Ruby JIT Compilation
 
Grape golilath
Grape golilathGrape golilath
Grape golilath
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
 
Ruby formatters 2019
Ruby formatters 2019Ruby formatters 2019
Ruby formatters 2019
 
Eliminating Giant VM Lock in Ruby through Hardware Transactional Memory (Ruby...
Eliminating Giant VM Lock in Ruby through Hardware Transactional Memory (Ruby...Eliminating Giant VM Lock in Ruby through Hardware Transactional Memory (Ruby...
Eliminating Giant VM Lock in Ruby through Hardware Transactional Memory (Ruby...
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formatters
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
javalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdfjavalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdf
 
Continuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise StackContinuous Integration to Shift Left Testing Across the Enterprise Stack
Continuous Integration to Shift Left Testing Across the Enterprise Stack
 
Building a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCPBuilding a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCP
 
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Highly Surmountable Challenges in Ruby+OMR JIT Compilation