SlideShare ist ein Scribd-Unternehmen logo
1 von 71
Downloaden Sie, um offline zu lesen
Sista: Improving 
Cog’s JIT 
performance 
Clément Béra
Main people involved in Sista 
• Eliot Miranda 
• Over 30 years experience in Smalltalk VM 
• Clément Béra 
• 2 years engineer in the Pharo team 
• Phd student starting from october
Cog ? 
• Smalltalk virtual machine 
• Runs Pharo, Squeak, Newspeak, ...
Plan 
• Efficient VM architecture (Java, C#, ...) 
• Sista goals 
• Example: optimizing a method 
• Our approach 
• Status
Virtual machine 
High level code (Java, Smalltalk ...) 
Runtime environment (JRE, JDK, Object engine...) 
CPU: intel, ARM ... - OS: Windows, Android, Linux ..
Basic Virtual machine 
High level code (Java, Smalltalk ...) 
Compiler 
Bytecode VM 
Bytecode 
Interpreter 
Memory Manager 
CPU RAM
Fast virtual machine 
High level code (Java, Smalltalk ...) 
Compiler 
Bytecode VM 
Bytecode 
Interpreter 
JIT 
Compiler 
Memory Manager 
CPU RAM
Efficient JIT compiler 
display: listOfDrinks 
listOfDrinks do: [ :drink | 
self displayOnScreen: drink ] 
Execution 
number 
time to 
run (ms) Comments 
1 1 lookup of #displayOnScreen (cache) and byte code interpretation 
2 to 6 0,5 byte code interpretation 
7 2 generation of native code for displayOnScreen and native code run 
8 to 999 0,01 nat•ive code run 
1000 2 adaptive recompilation based on runtime type information, generation 
of native code and optimized native code run 
1000 + 0,002 optimized native code run
In Cog 
display: listOfDrinks 
listOfDrinks do: [ :drink | 
self displayOnScreen: drink ] 
Execution 
number 
time to 
run (ms) Comments 
1 1 lookup of #displayOnScreen (cache) and byte code interpretation 
2 to 6 0,5 byte code interpretation 
7 2 generation of native code for display and native code run 
8 to 999 0,01 nat•ive code run 
1000 2 adaptive recompilation based on runtime type information, generation 
of native code and optimized native code run 
1000 + 0,002 optimized native code run
A look into webkit 
• Webkit Javascript engine 
• LLInt = Low Level Interpreter 
• DFG JIT = Data Flow Graph JIT
Webkit JS benchs
In Cog
What is Sista ? 
• Implementing the next JIT optimization 
level
Goals 
• Smalltalk performance 
• Code readability
Smalltalk performance 
The Computer Language Benchmarks Game
Smalltalk performance 
The Computer Language Benchmarks Game
Smalltalk performance 
The Computer Language Benchmarks Game 
Smalltalk is 4x~25x slower than Java
Smalltalk performance 
The Computer Language Benchmarks Game 
Smalltalk is 4x~25x slower than Java 
Our goal is 3x faster: 
1.6x~8x times slower than Java 
+ Smalltalk features
Code Readability 
• Messages optimized by the bytecode 
compiler overused in the kernel 
• #do: => #to:do:
Adaptive recompilation 
• Recompiles on-the-fly portion of code 
frequently used based on the current 
environment and previous executions
Optimizing a method
Example
Example 
• Executing #display: with over 30 000 
different drinks ...
Hot spot detector 
• Detects methods frequently used
Hot spot detector 
• JIT adds counters on machine code 
• Counters are incremented when code 
execution reaches it 
• When a counter reaches threshold, the 
optimizer is triggered
Example 
Cannot detect hot spot 
Can detect hot spot 
(#to:do: compiled inlined)
Hot spot detected 
Over 30 000 executions
Optimizer 
• What to optimize ?
Optimizer 
• What to optimize ? 
• Block evaluation is costly
Optimizer 
• What to optimize ? 
Stack frame 
#display: 
Stack frame 
#do: 
Stack 
growing 
Hot spot down 
detected 
here
Optimizer 
• What to optimize ? 
Stack frame 
#display: 
Stack frame 
#do: 
Hot spot 
detected 
here
Find the best method
Find the best method 
• To be able to optimize the 
block activation, we need 
to optimize both 
#example and #do:
Inlining 
• Replaces a function call by its callee
Inlining 
• Replaces a function call by its callee 
• Speculative: what if 
listOfDrinks is not an 
Array anymore ?
Inlining 
• Replaces a function call by its callee 
• Speculative: what if 
listOfDrinks is not an 
Array anymore ? 
• Type-feedback from 
inline caches
Guard 
• Guard checks: listOfDrinks hasClass: Array 
• If a guard fails, the execution stack is 
dynamically deoptimized 
• If a guard fails more than a threshold, the 
optimized method is uninstalled
Dynamic deoptimization 
• On Stack replacement 
• PCs, variables and methods are mapped. 
Stack frame 
#display: 
Stack frame 
#do: 
Stack frame 
#optimizedDisplay:
Optimizations 
• 1) #do: is inlined into #display:
Optimizations 
• 2) Block evaluation is inlined
Optimizations 
• 3) at: is optimized 
• at: optimized ???
At: implementation 
• VM implementation 
• Is index an integer ? 
• Is object a variable-sized object, a byte 
object, ... ? (Array, ByteArray, ... ?) 
• Is index within the bound of the object ? 
• Answers the value
Optimizations 
• 3) at: is optimized 
• index isSmallInteger 
• 1 <= index <= listOfDrinks size 
• listOfDrinks class == Array 
• uncheckedAt1: (at: for variable size objects with in-bounds 
integer argument)
Restarting 
• On Stack replacement 
Stack frame 
#display: 
Stack frame 
#do: 
Stack frame 
#optimizedDisplay:
Our approach
In-image Optimizer 
• Inputs 
• Stack with hot compiled method 
• Branch and type information 
• Actions 
• Generates and installs an optimized compiled method 
• Generates deoptimization metadata 
• Edit the stack to use the optimized compiled method
In-image Deoptimizer 
• Inputs 
• Stack to deoptimize (failing guard, 
debugger, ...) 
• Deoptimization metadata 
• Actions 
• Deoptimize the stack 
• May discard the optimized method
Advantages 
• Optimizer / Deoptimizer in smalltalk 
• Easier to debug and program in Smalltalk 
than in Slang / C 
• Editable at runtime 
• Lower engineering cost
Advantages 
On Stack replacement done with Context manipulation 
Stack frame 
#display: 
Stack frame 
#do: 
Stack frame 
#optimizedDisplay:
Cons 
• What if the optimizer is triggered while 
optimizing ?
Advantages 
• CompiledMethod to optimized CompiledMethod 
• Snapshot saves compiled methods
Cons 
• Some optimizations are difficult 
• Instruction selection 
• Instruction scheduling 
• Register allocation
Critical optimizations 
• Inlining (Methods and Closures) 
• Specialized at: and at:put: 
• Specialized arithmetic operations
Interface VM - Image 
• Extended bytecode set 
• CompiledMethod introspection primitive 
• VM callback to trigger optimizer /deoptimizer
Extended bytecode set 
• Guards 
• Specialized inlined primitives 
• at:, at:put: 
• +, - , <=, =, ...
Introspection primitive 
• Answers 
• Type info for each message send 
• Branch info for each conditional jump 
• Answers nothing if method not in machine 
code zone
VM callback 
• Selector in specialObjectsArray 
• Sent to the active context when hot spot / 
guard failure detected
Stability 
• Low engineering resources 
• No thousands of human testers
Stability 
• Gemstone style ? 
• Large test suites
Stability 
• RMOD research team 
• Inventing new validation techniques 
• Implementing state-of-the-art validators
Stability goal 
• Both bench and large test suite run on CI 
• Anyone could contribute
Anyone can contribute
Anyone can contribute
Stability goal 
• Both bench and large test suite run on CI 
• Anyone could contribute
Status 
• A full round trip works 
• Hot spot detected in the VM 
• In-image optimizer finds a method to 
optimize, optimizes it an install it 
• method and closure inlining 
• Stack dynamic deoptimization
Status: hot spot detector 
• Richards benchmark 
• Cog: 341ms 
• Cog + hot spot detector: 351ms 
• 3% overhead on Richards 
• Detects hot spots 
• Branch counts ⇒ basic block counts
Next steps 
• Dynamic deoptimization of closures is not 
stable enough 
• Efficient new bytecode instructions 
• Stabilizing bounds check elimination 
• lowering memory footprint 
• Invalidation of optimized methods 
• On stack replacement
Thanks 
• Stéphane Ducasse 
• Marcus Denker 
• Yaron Kashai
Conclusion 
• We hope to have a prototype running for 
Christmas 
• We hope to push it to production in 
around a year
Demo 
...
Questions

Weitere ähnliche Inhalte

Was ist angesagt?

Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05Alessandra Bilardi
 
Leveraging HP Performance Center
Leveraging HP Performance CenterLeveraging HP Performance Center
Leveraging HP Performance CenterMartin Spier
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKAJohan Edstrom
 
Real-Time Voice Actuation
Real-Time Voice ActuationReal-Time Voice Actuation
Real-Time Voice ActuationPragya Agrawal
 
Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)GlobalLogic Ukraine
 
Craftsmanship Workshop: Coding Kata
Craftsmanship Workshop: Coding KataCraftsmanship Workshop: Coding Kata
Craftsmanship Workshop: Coding KataMichael Ibarra
 
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...Dakiry
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applicationsRuslan Shevchenko
 
What’s expected in Spring 5
What’s expected in Spring 5What’s expected in Spring 5
What’s expected in Spring 5Gal Marder
 
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruitBruce Werdschinski
 
Introduction to ACI APIs
Introduction to ACI APIsIntroduction to ACI APIs
Introduction to ACI APIsCisco DevNet
 

Was ist angesagt? (20)

Ruby Under The Hood
Ruby Under The HoodRuby Under The Hood
Ruby Under The Hood
 
Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05Automation: from local test to production deploy - 2020-11-05
Automation: from local test to production deploy - 2020-11-05
 
Leveraging HP Performance Center
Leveraging HP Performance CenterLeveraging HP Performance Center
Leveraging HP Performance Center
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 
Real-Time Voice Actuation
Real-Time Voice ActuationReal-Time Voice Actuation
Real-Time Voice Actuation
 
Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)Take a Look at Akka+Java (English version)
Take a Look at Akka+Java (English version)
 
TestIstanbul 2015
TestIstanbul 2015TestIstanbul 2015
TestIstanbul 2015
 
Craftsmanship Workshop: Coding Kata
Craftsmanship Workshop: Coding KataCraftsmanship Workshop: Coding Kata
Craftsmanship Workshop: Coding Kata
 
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
 
Scaling tappsi
Scaling tappsiScaling tappsi
Scaling tappsi
 
Hystrix
HystrixHystrix
Hystrix
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
 
Optimizing Java Notes
Optimizing Java NotesOptimizing Java Notes
Optimizing Java Notes
 
Java & low latency applications
Java & low latency applicationsJava & low latency applications
Java & low latency applications
 
What’s expected in Spring 5
What’s expected in Spring 5What’s expected in Spring 5
What’s expected in Spring 5
 
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruit
 
Introduction to ACI APIs
Introduction to ACI APIsIntroduction to ACI APIs
Introduction to ACI APIs
 
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor BuzatovićJavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
 
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
Javantura v4 - FreeMarker in Spring web - Marin KalapaćJavantura v4 - FreeMarker in Spring web - Marin Kalapać
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
 

Ähnlich wie Sista: Improving Cog’s JIT performance

Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Fwdays
 
OrigoDB - take the red pill
OrigoDB - take the red pillOrigoDB - take the red pill
OrigoDB - take the red pillRobert Friberg
 
SPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic librarySPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic libraryAdaCore
 
Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoValeriia Maliarenko
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningjClarity
 
How to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseHow to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseSpeedment, Inc.
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
 
White and Black Magic on the JVM
White and Black Magic on the JVMWhite and Black Magic on the JVM
White and Black Magic on the JVMIvaylo Pashov
 
Episode 20 - Trigger Frameworks in Salesforce
Episode 20 - Trigger Frameworks in SalesforceEpisode 20 - Trigger Frameworks in Salesforce
Episode 20 - Trigger Frameworks in SalesforceJitendra Zaa
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
CassandraSummit2015_Cassandra upgrades at scale @ NETFLIX
CassandraSummit2015_Cassandra upgrades at scale @ NETFLIXCassandraSummit2015_Cassandra upgrades at scale @ NETFLIX
CassandraSummit2015_Cassandra upgrades at scale @ NETFLIXVinay Kumar Chella
 
Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native CompilerSimon Ritter
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedTim Callaghan
 
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapDEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapFelipe Prado
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the CloudJim Driscoll
 
Managing Millions of Tests Using Databricks
Managing Millions of Tests Using DatabricksManaging Millions of Tests Using Databricks
Managing Millions of Tests Using DatabricksDatabricks
 

Ähnlich wie Sista: Improving Cog’s JIT performance (20)

Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"
 
OrigoDB - take the red pill
OrigoDB - take the red pillOrigoDB - take the red pill
OrigoDB - take the red pill
 
SPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic librarySPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic library
 
Java Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey KovalenkoJava Jit. Compilation and optimization by Andrey Kovalenko
Java Jit. Compilation and optimization by Andrey Kovalenko
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
 
How to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseHow to generate customized java 8 code from your database
How to generate customized java 8 code from your database
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
 
White and Black Magic on the JVM
White and Black Magic on the JVMWhite and Black Magic on the JVM
White and Black Magic on the JVM
 
Episode 20 - Trigger Frameworks in Salesforce
Episode 20 - Trigger Frameworks in SalesforceEpisode 20 - Trigger Frameworks in Salesforce
Episode 20 - Trigger Frameworks in Salesforce
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
CassandraSummit2015_Cassandra upgrades at scale @ NETFLIX
CassandraSummit2015_Cassandra upgrades at scale @ NETFLIXCassandraSummit2015_Cassandra upgrades at scale @ NETFLIX
CassandraSummit2015_Cassandra upgrades at scale @ NETFLIX
 
Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapDEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Managing Millions of Tests Using Databricks
Managing Millions of Tests Using DatabricksManaging Millions of Tests Using Databricks
Managing Millions of Tests Using Databricks
 

Mehr von ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

Mehr von ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Kürzlich hochgeladen

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 

Kürzlich hochgeladen (20)

Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 

Sista: Improving Cog’s JIT performance

  • 1. Sista: Improving Cog’s JIT performance Clément Béra
  • 2. Main people involved in Sista • Eliot Miranda • Over 30 years experience in Smalltalk VM • Clément Béra • 2 years engineer in the Pharo team • Phd student starting from october
  • 3. Cog ? • Smalltalk virtual machine • Runs Pharo, Squeak, Newspeak, ...
  • 4. Plan • Efficient VM architecture (Java, C#, ...) • Sista goals • Example: optimizing a method • Our approach • Status
  • 5. Virtual machine High level code (Java, Smalltalk ...) Runtime environment (JRE, JDK, Object engine...) CPU: intel, ARM ... - OS: Windows, Android, Linux ..
  • 6. Basic Virtual machine High level code (Java, Smalltalk ...) Compiler Bytecode VM Bytecode Interpreter Memory Manager CPU RAM
  • 7. Fast virtual machine High level code (Java, Smalltalk ...) Compiler Bytecode VM Bytecode Interpreter JIT Compiler Memory Manager CPU RAM
  • 8. Efficient JIT compiler display: listOfDrinks listOfDrinks do: [ :drink | self displayOnScreen: drink ] Execution number time to run (ms) Comments 1 1 lookup of #displayOnScreen (cache) and byte code interpretation 2 to 6 0,5 byte code interpretation 7 2 generation of native code for displayOnScreen and native code run 8 to 999 0,01 nat•ive code run 1000 2 adaptive recompilation based on runtime type information, generation of native code and optimized native code run 1000 + 0,002 optimized native code run
  • 9. In Cog display: listOfDrinks listOfDrinks do: [ :drink | self displayOnScreen: drink ] Execution number time to run (ms) Comments 1 1 lookup of #displayOnScreen (cache) and byte code interpretation 2 to 6 0,5 byte code interpretation 7 2 generation of native code for display and native code run 8 to 999 0,01 nat•ive code run 1000 2 adaptive recompilation based on runtime type information, generation of native code and optimized native code run 1000 + 0,002 optimized native code run
  • 10. A look into webkit • Webkit Javascript engine • LLInt = Low Level Interpreter • DFG JIT = Data Flow Graph JIT
  • 13. What is Sista ? • Implementing the next JIT optimization level
  • 14. Goals • Smalltalk performance • Code readability
  • 15. Smalltalk performance The Computer Language Benchmarks Game
  • 16. Smalltalk performance The Computer Language Benchmarks Game
  • 17. Smalltalk performance The Computer Language Benchmarks Game Smalltalk is 4x~25x slower than Java
  • 18. Smalltalk performance The Computer Language Benchmarks Game Smalltalk is 4x~25x slower than Java Our goal is 3x faster: 1.6x~8x times slower than Java + Smalltalk features
  • 19. Code Readability • Messages optimized by the bytecode compiler overused in the kernel • #do: => #to:do:
  • 20. Adaptive recompilation • Recompiles on-the-fly portion of code frequently used based on the current environment and previous executions
  • 23. Example • Executing #display: with over 30 000 different drinks ...
  • 24. Hot spot detector • Detects methods frequently used
  • 25. Hot spot detector • JIT adds counters on machine code • Counters are incremented when code execution reaches it • When a counter reaches threshold, the optimizer is triggered
  • 26. Example Cannot detect hot spot Can detect hot spot (#to:do: compiled inlined)
  • 27. Hot spot detected Over 30 000 executions
  • 28. Optimizer • What to optimize ?
  • 29. Optimizer • What to optimize ? • Block evaluation is costly
  • 30. Optimizer • What to optimize ? Stack frame #display: Stack frame #do: Stack growing Hot spot down detected here
  • 31. Optimizer • What to optimize ? Stack frame #display: Stack frame #do: Hot spot detected here
  • 32. Find the best method
  • 33. Find the best method • To be able to optimize the block activation, we need to optimize both #example and #do:
  • 34. Inlining • Replaces a function call by its callee
  • 35. Inlining • Replaces a function call by its callee • Speculative: what if listOfDrinks is not an Array anymore ?
  • 36. Inlining • Replaces a function call by its callee • Speculative: what if listOfDrinks is not an Array anymore ? • Type-feedback from inline caches
  • 37. Guard • Guard checks: listOfDrinks hasClass: Array • If a guard fails, the execution stack is dynamically deoptimized • If a guard fails more than a threshold, the optimized method is uninstalled
  • 38. Dynamic deoptimization • On Stack replacement • PCs, variables and methods are mapped. Stack frame #display: Stack frame #do: Stack frame #optimizedDisplay:
  • 39. Optimizations • 1) #do: is inlined into #display:
  • 40. Optimizations • 2) Block evaluation is inlined
  • 41. Optimizations • 3) at: is optimized • at: optimized ???
  • 42. At: implementation • VM implementation • Is index an integer ? • Is object a variable-sized object, a byte object, ... ? (Array, ByteArray, ... ?) • Is index within the bound of the object ? • Answers the value
  • 43. Optimizations • 3) at: is optimized • index isSmallInteger • 1 <= index <= listOfDrinks size • listOfDrinks class == Array • uncheckedAt1: (at: for variable size objects with in-bounds integer argument)
  • 44. Restarting • On Stack replacement Stack frame #display: Stack frame #do: Stack frame #optimizedDisplay:
  • 46. In-image Optimizer • Inputs • Stack with hot compiled method • Branch and type information • Actions • Generates and installs an optimized compiled method • Generates deoptimization metadata • Edit the stack to use the optimized compiled method
  • 47. In-image Deoptimizer • Inputs • Stack to deoptimize (failing guard, debugger, ...) • Deoptimization metadata • Actions • Deoptimize the stack • May discard the optimized method
  • 48. Advantages • Optimizer / Deoptimizer in smalltalk • Easier to debug and program in Smalltalk than in Slang / C • Editable at runtime • Lower engineering cost
  • 49. Advantages On Stack replacement done with Context manipulation Stack frame #display: Stack frame #do: Stack frame #optimizedDisplay:
  • 50. Cons • What if the optimizer is triggered while optimizing ?
  • 51. Advantages • CompiledMethod to optimized CompiledMethod • Snapshot saves compiled methods
  • 52. Cons • Some optimizations are difficult • Instruction selection • Instruction scheduling • Register allocation
  • 53. Critical optimizations • Inlining (Methods and Closures) • Specialized at: and at:put: • Specialized arithmetic operations
  • 54. Interface VM - Image • Extended bytecode set • CompiledMethod introspection primitive • VM callback to trigger optimizer /deoptimizer
  • 55. Extended bytecode set • Guards • Specialized inlined primitives • at:, at:put: • +, - , <=, =, ...
  • 56. Introspection primitive • Answers • Type info for each message send • Branch info for each conditional jump • Answers nothing if method not in machine code zone
  • 57. VM callback • Selector in specialObjectsArray • Sent to the active context when hot spot / guard failure detected
  • 58. Stability • Low engineering resources • No thousands of human testers
  • 59. Stability • Gemstone style ? • Large test suites
  • 60. Stability • RMOD research team • Inventing new validation techniques • Implementing state-of-the-art validators
  • 61. Stability goal • Both bench and large test suite run on CI • Anyone could contribute
  • 64. Stability goal • Both bench and large test suite run on CI • Anyone could contribute
  • 65. Status • A full round trip works • Hot spot detected in the VM • In-image optimizer finds a method to optimize, optimizes it an install it • method and closure inlining • Stack dynamic deoptimization
  • 66. Status: hot spot detector • Richards benchmark • Cog: 341ms • Cog + hot spot detector: 351ms • 3% overhead on Richards • Detects hot spots • Branch counts ⇒ basic block counts
  • 67. Next steps • Dynamic deoptimization of closures is not stable enough • Efficient new bytecode instructions • Stabilizing bounds check elimination • lowering memory footprint • Invalidation of optimized methods • On stack replacement
  • 68. Thanks • Stéphane Ducasse • Marcus Denker • Yaron Kashai
  • 69. Conclusion • We hope to have a prototype running for Christmas • We hope to push it to production in around a year