SlideShare uma empresa Scribd logo
1 de 59
A JVM’s Journey Into Polyglot Runtimes
Charlie Gracie
February 8, 2016
OMR
Who am I?
Charlie Gracie
charlie_gracie@ca.ibm.com
@crgracie
2
• Garbage Collection Architect
for IBM J9 JVM
• Current focus on developing
technologies for the OMR
project
3
Java and the JVM
4
It’s a Polyglot World
5
• Effort in one runtime has no leverage in other runtimes
• …looking very costly to support many language runtimes
No Shared Technology
Languages on The JVM
• Leverage the investment in JVM
• Cross platform support
• High performance runtime
• Production quality
• Tooling / monitoring support
• Interoperability with Java
6
Languages on The JVM
• Works great for new languages like Scala and Groovy
• Existing languages have vibrant communities
• Not all languages map nicely to Java semantics
• We decided to experiment with a different approach that
would allow new and existing language communities to
leverage JVM capabilities
7
An open source toolkit for
language runtime
technologies.
OMR
Open Source Toolkit for Building Runtimes
• Eclipse OMR project proposal
• https://goo.gl/ZTBoeu
• Will be open sourced under EPL
• Derived from the source code of IBM’s
production runtimes
9
Open Source Toolkit for Building Runtimes
• Implements language-agnostic parts of a
managed runtime
• Bootstraps development of new runtimes
10
Open Source Toolkit for Building Runtimes
• Allows incremental enablement of advanced
functionality
• Easily leverage new hardware features
• GPU
• FPGA
11
Open Source Toolkit for Building Runtimes
• Shipped as part of IBM SDK for Java 8
• Development of IBM SDK for Java 9
consuming OMR daily
• Proof-of-concept integration with Ruby MRI,
CPython, SOM++
12
Execution Environment
Language Runtime Components
Platform Abstraction Layer
Garbage Collector
Diagnostic Services
Source Code Bytecode/AST
Compiler
13
Just-In-Time Compiler
InterpreterSource Bytecode
Compiler
Interpreter
Execution Environment
Language-Agnostic Components
Platform Abstraction Layer
Garbage Collector
Diagnostic Services
Source Code Bytecode/AST
Compiler
14
Just-In-Time Compiler
InterpreterSource Bytecode
Compiler
Interpreter
Gluing it Together
Interpreter
15
Bytecode
/AST
Compiler
Garbage
Collector
GC Glue
Just-In-Time
Compiler
JIT Glue
Diagnostic
Services
D.
Glue
Ruby + OMR Preview
Ruby + OMR Preview
17
• GitHub location for the preview
• https://goo.gl/P3yXuy
• Available as Docker images
Ruby + OMR Preview
18
• Based on Ruby 2.2.3
• Working to merge with the master branch
• Successfully passes “make test”
• Runs rails apps
Ruby + OMR Preview
19
• Integrated OMR components include
• Platform Abstraction Layer
• Garbage Collection
• Just In Time Compilation
• Diagnostic Tooling
Garbage Collection
Our
Strategy:
• Be 100% compatible
21
Our
Strategy:
• Be 100% compatible
• Decrease pause times
22
Our
Strategy:
• Be 100% compatible
• Decrease pause times
• Increase allocation speed
23
Our
Strategy:
• Be 100% compatible
• Decrease pause times
• Increase allocation speed
• Improve object locality
24
100% Compatible
25
• Do not break C extensions
• Pass all tests that ship with MRI
• Test 3rd party applications
Decrease Pause Times
26
• Complete the following in parallel
• Root Marking
• Object tracing
• Object finalization
• Sweep
Increase Allocation Speed
27
• Use TLH mechanism from OMR
• Threads reserve blocks of heap memory
for exclusive allocation
• Threads bump allocate out of these blocks
alloc(rbthread_t thread, int size)
if (thread->tlhAlloc < thread->tlhTop - size)
object = thread->tlhAlloc
thread->tlhAlloc = object + size
else
object = OMR_GC_Allocate(thread, size);
Improve Object Locality
28
• Create new OMRBuffer object type
• Allocate OMRBuffers on heap
• Data is regularly adjacent to object in heap
• OMRBuffers are automatically reclaimed
during collection
Decrease Pause Times
29
• OMRBuffers do not require calls to obj_free
• Significant reduction in pause times
Future Work
30
• Improve heap fragmentation
• Add support for concurrent marking
Just In Time Compilation
Our
Strategy:
• Mimic interpreter
for maximum
compatibility.
• Implement
simple opcodes
directly in IL
32
IL
Our
Strategy:
• Build callbacks to
VM for complex
opcodes.
• Automatically
generate
callbacks from
the instruction
definition file.
33
IL
callback
Our
Strategy:
• Fast-path
particular
patterns
• e.g trace
34
IL
callback
IL
IL
callback
Our
Strategy:
• Don’t try to
handle
everything – let
interpreter
handle hard
cases!
35
IL
callback
IL
IL
callback
Current Status
• Supports almost all opcodes
• Compile iseq after they are executed N times
• Dispatch to JIT code if the iseq has been
compiled
Future Work
37
• Speculative optimizations powered by
decompilation and code-patching
• Class Hierarchy Based Optimization
• Guarded inlining
• Type Specialization
• Recompilation
• Interpreter and JIT Profiling
• Asynchronous Compilation
• More optimization!
• OMR’s Ruby JIT uses only 10 / 100+ optimizations.
Diagnostic Tooling
39
<af-start id="17" threadId="00007F2F3137CFD0" totalBytesRequested="8208" timestamp="2015-12-17T02:16:21.412"
intervalms="23.538" />
<cycle-start id="18" type="global" contextid="0" timestamp="2015-12-17T02:16:21.413" intervalms="23.541" />
<gc-start id="19" type="global" contextid="18" timestamp="2015-12-17T02:16:21.413">
<mem-info id="20" free="201320" total="4194304" percent="4">
<mem type="tenure" free="201320" total="4194304" percent="4" />
</mem-info>
</gc-start>
<allocation-stats totalBytes="2009264" >
<allocated-bytes non-tlh="46328" tlh="1962936" />
<largest-consumer threadName="OMR_VMThread [" threadId="00007F2F313786E0" bytes="2009264" />
</allocation-stats>
<gc-op id="21" type="mark" timems="3.660" contextid="18" timestamp="2015-12-17T02:16:21.417">
<trace-info objectcount="27053" scancount="23093" scanbytes="926304" />
</gc-op>
<gc-op id="24" type="sweep" timems="0.232" contextid="18" timestamp="2015-12-17T02:16:21.417" />
<gc-end id="25" type="global" contextid="18" durationms="4.967" usertimems="4.256" systemtimems="0.000" timestamp="2015-12-
17T02:16:21.418" activeThreads="1">
<mem-info id="26" free="1467848" total="4194304" percent="34">
<mem type="tenure" free="1467848" total="4194304" percent="34" />
</mem-info>
</gc-end>
<cycle-end id="27" type="global" contextid="18" timestamp="2015-12-17T02:16:21.418" />
<allocation-satisfied id="28" threadId="00007F2F313786E0" bytesRequested="8208" />
<af-end id="29" timestamp="2015-12-17T02:16:21.418" threadId="00007F2F3137CFD0" success="true" />
Verbose:gc Output
Garbage Collection and Memory Visualizer
40
• Provides a graphical details on GC events
post mortem from verbose:gc logs
• Works with IBM JDK, IBM Node.js and all of
our proof-of-concepts
• https://goo.gl/YwNrmI
Garbage Collection and Memory Visualizer
41
Health Center
42
• Provides a live view of runtime details
• Works with IBM JDK, IBM Node.js and all of
our proof-of-concepts
• http://goo.gl/u3VITI
Health Center – GC Statistics
43
Health Center – Ruby Method Profiling
44
Performance Results
46
112.84
122.57
0
20
40
60
80
100
120
140
Ruby 2.2.2 Ruby 2.2.2 + OMR
Is Ruby Fast Yet?
47
SpeedupRelativetoInterpreter
Micro Benchmarks
3x
2x
1x
27.8
16.6
5.3
0
5
10
15
20
25
30
Ruby 2.2.2 Ruby 2.2.2 + OMR Ruby 2.2.2 + OMR +JIT
pow(2,n)
Parting Thoughts
• Almost no one starts a new project saying:
49
Parting Thoughts
• Almost no one starts a new project saying:
– First, I’ll write the firmware from scratch…
50
Parting Thoughts
• Almost no one starts a new project saying:
– First, I’ll write the firmware from scratch…
– First, I’ll write the file system from scratch…
51
Parting Thoughts
• Almost no one starts a new project saying:
– First, I’ll write the firmware from scratch …
– First, I’ll write the file system from scratch …
– First, I’ll write the display drivers from scratch …
52
Parting Thoughts
• Almost no one starts a new project saying:
– First, I’ll write the firmware from scratch …
– First, I’ll write the file system from scratch …
– First, I’ll write the display drivers from scratch …
• We would like to make these statements just as unlikely:
– First, I’ll write the cross platform port library from scratch …
– First, I’ll write a garbage collector from scratch …
– First, I’ll write the JIT compiler from scratch …
53
Thank you!
John Duimovich
CTO IBM Runtimes
duimovic@ca.ibm.com
@jduimovich
Contact Info
Mark Stoodley
OMR Project Lead
mstoodle@ca.ibm.com
@mstoodle
56
Charlie Gracie
OMR GC Architect
crgracie@ca.ibm.com
@crgracie
Questions?
Trademarks, Copyrights, Disclaimers
58
IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without
notice at IBM’s sole discretion. Information regarding potential future products is intended to outline our
general product direction and it should not be relied on in making a purchasing decision. The information
mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver
any material, code or functionality. Information about potential future products may not be incorporated into
any contract. The development, release, and timing of any future features or functionality described for our
products remains at our sole discretion.
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp.,
registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other
companies. A current list of other IBM trademarks is available on the web at "Copyright and trademark information" at
http://www.ibm.com/legal/copytrade.shtml
Other company, product, or service names may be trademarks or service marks of others.
THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY.
WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION
CONTAINED IN THIS PRESENTATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY,
WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY
DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER
DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, NOR SHALL HAVE THE
EFFECT OF, CREATING ANY WARRANTIES OR REPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR
LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE
USE OF IBM PRODUCTS OR SOFTWARE.
© Copyright International Business Machines Corporation 2015. All rights reserved.
Additional Important Disclaimers
• THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL
PURPOSES ONLY.
• WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE
INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY
OF ANY KIND, EXPRESS OR IMPLIED.
• ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A
CONTROLLED ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE,
SOFTWARE OR INFRASTRUCTURE DIFFERENCES.
• ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE.
• IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT
PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE.
• IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING
OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER
DOCUMENTATION.
• NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
• - CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS
OR THEIR SUPPLIERS AND/OR LICENSORS
59

Mais conteúdo relacionado

Mais procurados

a quick Introduction to PyPy
a quick Introduction to PyPya quick Introduction to PyPy
a quick Introduction to PyPy
Kai Aras
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
oscon2007
 
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOUHOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
Lucas Jellema
 
Introduction to llvm
Introduction to llvmIntroduction to llvm
Introduction to llvm
Tao He
 

Mais procurados (20)

a quick Introduction to PyPy
a quick Introduction to PyPya quick Introduction to PyPy
a quick Introduction to PyPy
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Jit builder status and directions 2018 03-28
Jit builder status and directions 2018 03-28Jit builder status and directions 2018 03-28
Jit builder status and directions 2018 03-28
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
J9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVMJ9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVM
 
FOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VMFOSDEM 2017 - Open J9 The Next Free Java VM
FOSDEM 2017 - Open J9 The Next Free Java VM
 
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOUHOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
HOW AND WHY GRAALVM IS QUICKLY BECOMING RELEVANT FOR YOU
 
Introduction to llvm
Introduction to llvmIntroduction to llvm
Introduction to llvm
 
Python on Android with Delphi FMX - The Cross Platform GUI Framework
Python on Android with Delphi FMX - The Cross Platform GUI Framework Python on Android with Delphi FMX - The Cross Platform GUI Framework
Python on Android with Delphi FMX - The Cross Platform GUI Framework
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
 
Challenges in Debugging Bootstraps of Reflective Kernels
Challenges in Debugging Bootstraps of Reflective KernelsChallenges in Debugging Bootstraps of Reflective Kernels
Challenges in Debugging Bootstraps of Reflective Kernels
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Micro servoces-choose-the-right-tools-programing-language
Micro servoces-choose-the-right-tools-programing-languageMicro servoces-choose-the-right-tools-programing-language
Micro servoces-choose-the-right-tools-programing-language
 
Launchpad: Lessons Learnt
Launchpad: Lessons LearntLaunchpad: Lessons Learnt
Launchpad: Lessons Learnt
 
Python for Delphi Developers - Part 2
Python for Delphi Developers - Part 2Python for Delphi Developers - Part 2
Python for Delphi Developers - Part 2
 
Tail Call Elimination in Open Smalltalk
Tail Call Elimination in Open SmalltalkTail Call Elimination in Open Smalltalk
Tail Call Elimination in Open Smalltalk
 
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
Introduction to Python GUI development with Delphi for Python - Part 1:   Del...Introduction to Python GUI development with Delphi for Python - Part 1:   Del...
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
 
FMXLinux Introduction - Delphi's FireMonkey for Linux
FMXLinux Introduction - Delphi's FireMonkey for LinuxFMXLinux Introduction - Delphi's FireMonkey for Linux
FMXLinux Introduction - Delphi's FireMonkey for Linux
 
Jax keynote
Jax keynoteJax keynote
Jax keynote
 

Semelhante a Jfokus 2016 - A JVMs Journey into Polyglot Runtimes

Semelhante a Jfokus 2016 - A JVMs Journey into Polyglot Runtimes (20)

The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015The OMR GC talk - Ruby Kaigi 2015
The OMR GC talk - Ruby Kaigi 2015
 
Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
Eclipse OMR: a modern, open-source toolkit for building language runtimes
Eclipse OMR: a modern, open-source toolkit for building language runtimesEclipse OMR: a modern, open-source toolkit for building language runtimes
Eclipse OMR: a modern, open-source toolkit for building language runtimes
 
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
 
Simple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvmSimple tweaks to get the most out of your jvm
Simple tweaks to get the most out of your jvm
 
VMM2016-Eclipse OMR JITBuilder for better performance
VMM2016-Eclipse OMR JITBuilder for better performanceVMM2016-Eclipse OMR JITBuilder for better performance
VMM2016-Eclipse OMR JITBuilder for better performance
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdf
 
Simple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVM
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложений
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
DevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile GamesDevOpsCon 2015 - DevOps in Mobile Games
DevOpsCon 2015 - DevOps in Mobile Games
 
Mongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam HelmanMongo db - How we use Go and MongoDB by Sam Helman
Mongo db - How we use Go and MongoDB by Sam Helman
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
javalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdfjavalightspeed-jakartatech-2023.pdf
javalightspeed-jakartatech-2023.pdf
 
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit EuropeAutomation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Último (20)

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 

Jfokus 2016 - A JVMs Journey into Polyglot Runtimes

  • 1. A JVM’s Journey Into Polyglot Runtimes Charlie Gracie February 8, 2016 OMR
  • 2. Who am I? Charlie Gracie charlie_gracie@ca.ibm.com @crgracie 2 • Garbage Collection Architect for IBM J9 JVM • Current focus on developing technologies for the OMR project
  • 5. 5 • Effort in one runtime has no leverage in other runtimes • …looking very costly to support many language runtimes No Shared Technology
  • 6. Languages on The JVM • Leverage the investment in JVM • Cross platform support • High performance runtime • Production quality • Tooling / monitoring support • Interoperability with Java 6
  • 7. Languages on The JVM • Works great for new languages like Scala and Groovy • Existing languages have vibrant communities • Not all languages map nicely to Java semantics • We decided to experiment with a different approach that would allow new and existing language communities to leverage JVM capabilities 7
  • 8. An open source toolkit for language runtime technologies. OMR
  • 9. Open Source Toolkit for Building Runtimes • Eclipse OMR project proposal • https://goo.gl/ZTBoeu • Will be open sourced under EPL • Derived from the source code of IBM’s production runtimes 9
  • 10. Open Source Toolkit for Building Runtimes • Implements language-agnostic parts of a managed runtime • Bootstraps development of new runtimes 10
  • 11. Open Source Toolkit for Building Runtimes • Allows incremental enablement of advanced functionality • Easily leverage new hardware features • GPU • FPGA 11
  • 12. Open Source Toolkit for Building Runtimes • Shipped as part of IBM SDK for Java 8 • Development of IBM SDK for Java 9 consuming OMR daily • Proof-of-concept integration with Ruby MRI, CPython, SOM++ 12
  • 13. Execution Environment Language Runtime Components Platform Abstraction Layer Garbage Collector Diagnostic Services Source Code Bytecode/AST Compiler 13 Just-In-Time Compiler InterpreterSource Bytecode Compiler Interpreter
  • 14. Execution Environment Language-Agnostic Components Platform Abstraction Layer Garbage Collector Diagnostic Services Source Code Bytecode/AST Compiler 14 Just-In-Time Compiler InterpreterSource Bytecode Compiler Interpreter
  • 15. Gluing it Together Interpreter 15 Bytecode /AST Compiler Garbage Collector GC Glue Just-In-Time Compiler JIT Glue Diagnostic Services D. Glue
  • 16. Ruby + OMR Preview
  • 17. Ruby + OMR Preview 17 • GitHub location for the preview • https://goo.gl/P3yXuy • Available as Docker images
  • 18. Ruby + OMR Preview 18 • Based on Ruby 2.2.3 • Working to merge with the master branch • Successfully passes “make test” • Runs rails apps
  • 19. Ruby + OMR Preview 19 • Integrated OMR components include • Platform Abstraction Layer • Garbage Collection • Just In Time Compilation • Diagnostic Tooling
  • 21. Our Strategy: • Be 100% compatible 21
  • 22. Our Strategy: • Be 100% compatible • Decrease pause times 22
  • 23. Our Strategy: • Be 100% compatible • Decrease pause times • Increase allocation speed 23
  • 24. Our Strategy: • Be 100% compatible • Decrease pause times • Increase allocation speed • Improve object locality 24
  • 25. 100% Compatible 25 • Do not break C extensions • Pass all tests that ship with MRI • Test 3rd party applications
  • 26. Decrease Pause Times 26 • Complete the following in parallel • Root Marking • Object tracing • Object finalization • Sweep
  • 27. Increase Allocation Speed 27 • Use TLH mechanism from OMR • Threads reserve blocks of heap memory for exclusive allocation • Threads bump allocate out of these blocks alloc(rbthread_t thread, int size) if (thread->tlhAlloc < thread->tlhTop - size) object = thread->tlhAlloc thread->tlhAlloc = object + size else object = OMR_GC_Allocate(thread, size);
  • 28. Improve Object Locality 28 • Create new OMRBuffer object type • Allocate OMRBuffers on heap • Data is regularly adjacent to object in heap • OMRBuffers are automatically reclaimed during collection
  • 29. Decrease Pause Times 29 • OMRBuffers do not require calls to obj_free • Significant reduction in pause times
  • 30. Future Work 30 • Improve heap fragmentation • Add support for concurrent marking
  • 31. Just In Time Compilation
  • 32. Our Strategy: • Mimic interpreter for maximum compatibility. • Implement simple opcodes directly in IL 32 IL
  • 33. Our Strategy: • Build callbacks to VM for complex opcodes. • Automatically generate callbacks from the instruction definition file. 33 IL callback
  • 34. Our Strategy: • Fast-path particular patterns • e.g trace 34 IL callback IL IL callback
  • 35. Our Strategy: • Don’t try to handle everything – let interpreter handle hard cases! 35 IL callback IL IL callback
  • 36. Current Status • Supports almost all opcodes • Compile iseq after they are executed N times • Dispatch to JIT code if the iseq has been compiled
  • 37. Future Work 37 • Speculative optimizations powered by decompilation and code-patching • Class Hierarchy Based Optimization • Guarded inlining • Type Specialization • Recompilation • Interpreter and JIT Profiling • Asynchronous Compilation • More optimization! • OMR’s Ruby JIT uses only 10 / 100+ optimizations.
  • 39. 39 <af-start id="17" threadId="00007F2F3137CFD0" totalBytesRequested="8208" timestamp="2015-12-17T02:16:21.412" intervalms="23.538" /> <cycle-start id="18" type="global" contextid="0" timestamp="2015-12-17T02:16:21.413" intervalms="23.541" /> <gc-start id="19" type="global" contextid="18" timestamp="2015-12-17T02:16:21.413"> <mem-info id="20" free="201320" total="4194304" percent="4"> <mem type="tenure" free="201320" total="4194304" percent="4" /> </mem-info> </gc-start> <allocation-stats totalBytes="2009264" > <allocated-bytes non-tlh="46328" tlh="1962936" /> <largest-consumer threadName="OMR_VMThread [" threadId="00007F2F313786E0" bytes="2009264" /> </allocation-stats> <gc-op id="21" type="mark" timems="3.660" contextid="18" timestamp="2015-12-17T02:16:21.417"> <trace-info objectcount="27053" scancount="23093" scanbytes="926304" /> </gc-op> <gc-op id="24" type="sweep" timems="0.232" contextid="18" timestamp="2015-12-17T02:16:21.417" /> <gc-end id="25" type="global" contextid="18" durationms="4.967" usertimems="4.256" systemtimems="0.000" timestamp="2015-12- 17T02:16:21.418" activeThreads="1"> <mem-info id="26" free="1467848" total="4194304" percent="34"> <mem type="tenure" free="1467848" total="4194304" percent="34" /> </mem-info> </gc-end> <cycle-end id="27" type="global" contextid="18" timestamp="2015-12-17T02:16:21.418" /> <allocation-satisfied id="28" threadId="00007F2F313786E0" bytesRequested="8208" /> <af-end id="29" timestamp="2015-12-17T02:16:21.418" threadId="00007F2F3137CFD0" success="true" /> Verbose:gc Output
  • 40. Garbage Collection and Memory Visualizer 40 • Provides a graphical details on GC events post mortem from verbose:gc logs • Works with IBM JDK, IBM Node.js and all of our proof-of-concepts • https://goo.gl/YwNrmI
  • 41. Garbage Collection and Memory Visualizer 41
  • 42. Health Center 42 • Provides a live view of runtime details • Works with IBM JDK, IBM Node.js and all of our proof-of-concepts • http://goo.gl/u3VITI
  • 43. Health Center – GC Statistics 43
  • 44. Health Center – Ruby Method Profiling 44
  • 48. 27.8 16.6 5.3 0 5 10 15 20 25 30 Ruby 2.2.2 Ruby 2.2.2 + OMR Ruby 2.2.2 + OMR +JIT pow(2,n)
  • 49. Parting Thoughts • Almost no one starts a new project saying: 49
  • 50. Parting Thoughts • Almost no one starts a new project saying: – First, I’ll write the firmware from scratch… 50
  • 51. Parting Thoughts • Almost no one starts a new project saying: – First, I’ll write the firmware from scratch… – First, I’ll write the file system from scratch… 51
  • 52. Parting Thoughts • Almost no one starts a new project saying: – First, I’ll write the firmware from scratch … – First, I’ll write the file system from scratch … – First, I’ll write the display drivers from scratch … 52
  • 53. Parting Thoughts • Almost no one starts a new project saying: – First, I’ll write the firmware from scratch … – First, I’ll write the file system from scratch … – First, I’ll write the display drivers from scratch … • We would like to make these statements just as unlikely: – First, I’ll write the cross platform port library from scratch … – First, I’ll write a garbage collector from scratch … – First, I’ll write the JIT compiler from scratch … 53
  • 55.
  • 56. John Duimovich CTO IBM Runtimes duimovic@ca.ibm.com @jduimovich Contact Info Mark Stoodley OMR Project Lead mstoodle@ca.ibm.com @mstoodle 56 Charlie Gracie OMR GC Architect crgracie@ca.ibm.com @crgracie
  • 58. Trademarks, Copyrights, Disclaimers 58 IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion. Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion. IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of other IBM trademarks is available on the web at "Copyright and trademark information" at http://www.ibm.com/legal/copytrade.shtml Other company, product, or service names may be trademarks or service marks of others. THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, NOR SHALL HAVE THE EFFECT OF, CREATING ANY WARRANTIES OR REPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE USE OF IBM PRODUCTS OR SOFTWARE. © Copyright International Business Machines Corporation 2015. All rights reserved.
  • 59. Additional Important Disclaimers • THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. • WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. • ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR INFRASTRUCTURE DIFFERENCES. • ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE. • IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE. • IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. • NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF: • - CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS OR THEIR SUPPLIERS AND/OR LICENSORS 59