SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler offline
Improving Pharo
Snapshots
P. Tesone - G. Polito - N. Palumbo - ESUG’22
@tesonep
@guillep
@noTwitter
guillermo.polito@univ-lille.fr
pablo.tesone@inria.fr
nahuel.palumbo@inria.fr
2022 VM+ Team
2
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Everythingis an Object
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Everythingis an Object
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Everythingis an Object
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Everythingis an Object
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Everythingis an Object
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Lots of Objects
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Lots of Objects
Lots of Stress
• GC Stress
• Autocompletion Stress
• Search Stress
• Spotter Stress
• Startup Stress
Lots of Objects
Lots of Stress
Large Image Support
• https://github.com/pharo-project/largeImages
• MIT Licenced
Large Image Support: Highlights
• Generator based searches
• Spotter
• Code Completion
• GC Fine Tuning API
generator
^ generator ifNil: [
generator := Generator on: [ :g |
self entriesDo: [ :entry |
(self acceptsEntry: entry)
ifTrue: [ g yield: entry ] ] ] ]
GC Fine Tuning
• Con
fi
gure
• Eden Size
• Full GC Ratio
• Growth Headroom
• Shrink Threshold
GCConfiguration readFromVM
fullGCRatio: 1.0;
activeDuring: [ “something" ].
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Lots of Objects
• Numbers
• Characters
• Strings
• Arrays
• Closures
• Classes
• Methods
• …
Images = Heap Snapshots
.image
save
load
Heap
Snapshot Current Design Points
• Bootstrap once, then mutate
• Portable
• Object References are pointers
• Load code
• Create Objects
• Run your app
• Maybe GC!
• Repeat
.image .image
Heap
But it could be better…
• VM startup is bound by disk!
• Large heaps take long to load/save
• 3-4GB heaps = seconds to GC
• pauses
• long pauses
• Load code
• Create Objects
• Run your app
• Maybe GC!
• Repeat
.image .image
Heap
Snapshots vs Runtime Memory Mismatch
App and System Objects
Threads State
as Objects
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
.image
Current Loading Snapshot to Memory
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
Direct Mapping
Rebuild
Empty Empty
.image App and System Objects
Threads State
as Objects
Start with a cold VM,
startup is slow
Reference Swizzling
• Traverse the heap to remap old references by delta
• Slow for large heaps (2/4GB)
Hot Methods
Machine Code
Process 1 Thread
Stacks
New Objects Old Objects
Hot Methods
Machine Code
Process 2 Thread
Stacks
New Objects Old Objects
R
e
m
a
p
p
e
d
delta
Current Snapshot to Disk
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
App and System Objects
Threads State
as Objects
.image
Current Snapshot to Disk
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
1.Discard
App and System Objects
Threads State
as Objects
.image
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
1.Discard 2. Save as
objects
App and System Objects
Threads State
as Objects
.image
Current Snapshot to Disk
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
1.Discard 2. Save as
objects
3. Promote
to old
App and System Objects
Threads State
as Objects
.image
Current Snapshot to Disk
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
1.Discard 2. Save as
objects
3. Promote
to old
4. Save to
Disk
App and System Objects
Threads State
as Objects
.image
Current Snapshot to Disk
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
1.Discard 2. Save as
objects
3. Promote
to old
4. Save to
Disk
Discards all optimisations:
slow shutdown => slow
startup
App and System Objects
Threads State
as Objects
.image
Current Snapshot to Disk
Goals
• Faster loading
• Faster snapshot
• Faster Multi-GB Heaps
• Load code
• Create Objects
• Run your app
• Maybe GC!
• Repeat
.image .image
Heap
Towards a Multi-file Snapshot Format
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
Direct Mapping
.image
• System memory mapping
• Minimize Swizzling
• Lazy loading of memory segments
Multiple Memory Segments
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
Direct Mapping
.image
• Independently and lazy loadable
• Independently storable
Old Objects’
Old Objects’
New Memory Segments
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
Direct Mapping
.image
• Reduced garbage collection pressure
• Great for opaque objects, and rarely changing objects
(code, literals…)
Perm Objects
Perm Objects
Semi-permanent Heap Segments
Heap
Separating Permanent Objects
• Permanent objects are roots
• But not all of them are roots
• We don’t want to iterate all permanent objects!
Maintaining a Remembered Set
• Get the real roots in a remembered set
• Updated with a write barrier and cleaned at GC
Semi-permanent Object Selection
Bad Semi-permanent Object Selection
Worst case: all permanent
are remembered (!!)
What objects should be permanent?
What objects should be permanent?
How to
minimise
remembered
objects?
Pitfalls of Semi-permanent Object Selection
• The remembered set can explode easily. E.g.,
• Objects that reference nil, true, false are always remembered
• If you make a class permanent
• => you probably want to make its method dictionary too
• => and its methods, and literals
• => and …
Potential: GC cut by half
• For production Apps!
• Some Heuristics:
• Code (+related) is semi-permanent
• Collections go with their inner array
• Association values are not (!!)
Relative Speedups
Automatic Object Selection via Simulations
• Estimate
• permanent segment size
• remembered set size
• Understand the leaking reasons
• And extract better heuristics for production code
(e.g., better move all classes with all method dictionaries…)
Future Perspectives
• Sharing permanent immutable objects, copy on write
• Scaling multi-process applications
• Application-speci
fi
c permanent object selection
JIT
Machine Code
Thread
Stacks
New Objects Old Objects Perm Objects
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
JIT
Machine Code
Thread
Stacks
New Objects Old Objects
We are hiring!
• We have
• Engineer Positions
• Phd Positions
• Keywords: Compilers, Interpreters, Memory Management, Security
• Come talk to us!
42
Conclusion
• Multi-
fi
le snapshot format
• Permanent Objects and Selection
• 2x GC improvements
• Load code
• Create Objects
• Run your app
• Maybe GC!
• Repeat
.image .image
JIT
Machine Code
Thread
Stacks
New Objects Old Objects Perm Objects
Relative Speedups

Mais conteúdo relacionado

Mais procurados

re:mobidyc the overview
re:mobidyc the overviewre:mobidyc the overview
re:mobidyc the overviewESUG
 
How Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear RegressionHow Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear RegressionESUG
 
PharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript ApplicationsPharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript ApplicationsESUG
 
Pharo foreign function interface (FFI) by example by Esteban Lorenzano
Pharo foreign function interface (FFI) by example by Esteban LorenzanoPharo foreign function interface (FFI) by example by Esteban Lorenzano
Pharo foreign function interface (FFI) by example by Esteban LorenzanoFAST
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Applications in Pharo
Applications in PharoApplications in Pharo
Applications in PharoESUG
 
Pharo 11: A stabilization release
Pharo 11: A stabilization releasePharo 11: A stabilization release
Pharo 11: A stabilization releaseESUG
 
Best Practices in Exception Handling
Best Practices in Exception HandlingBest Practices in Exception Handling
Best Practices in Exception HandlingLemi Orhan Ergin
 
Identifying and Managing Technical Debt
Identifying and Managing Technical DebtIdentifying and Managing Technical Debt
Identifying and Managing Technical Debtzazworka
 
Pharo Networking by Example
Pharo Networking by ExamplePharo Networking by Example
Pharo Networking by ExampleNoury Bouraqadi
 
Music With Pharo
Music With PharoMusic With Pharo
Music With PharoESUG
 
Từ Gà Đến Pro Git và GitHub trong 60 phút
Từ Gà Đến Pro Git và GitHub trong 60 phútTừ Gà Đến Pro Git và GitHub trong 60 phút
Từ Gà Đến Pro Git và GitHub trong 60 phútHuy Hoàng Phạm
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitColin Su
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and GithubHouari ZEGAI
 
Embedded Systems: Lecture 1: Course Overview
Embedded Systems: Lecture 1: Course OverviewEmbedded Systems: Lecture 1: Course Overview
Embedded Systems: Lecture 1: Course OverviewAhmed El-Arabawy
 
Intégration de SonarQube dans GitLab ci
Intégration de SonarQube dans GitLab ciIntégration de SonarQube dans GitLab ci
Intégration de SonarQube dans GitLab ciwiemfourati
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaCharles Nutter
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
 

Mais procurados (20)

re:mobidyc the overview
re:mobidyc the overviewre:mobidyc the overview
re:mobidyc the overview
 
How Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear RegressionHow Fast is AI in Pharo? Benchmarking Linear Regression
How Fast is AI in Pharo? Benchmarking Linear Regression
 
PharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript ApplicationsPharoJS: Pharo-Based TDD for Javascript Applications
PharoJS: Pharo-Based TDD for Javascript Applications
 
Pharo foreign function interface (FFI) by example by Esteban Lorenzano
Pharo foreign function interface (FFI) by example by Esteban LorenzanoPharo foreign function interface (FFI) by example by Esteban Lorenzano
Pharo foreign function interface (FFI) by example by Esteban Lorenzano
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Applications in Pharo
Applications in PharoApplications in Pharo
Applications in Pharo
 
Pharo 11: A stabilization release
Pharo 11: A stabilization releasePharo 11: A stabilization release
Pharo 11: A stabilization release
 
Best Practices in Exception Handling
Best Practices in Exception HandlingBest Practices in Exception Handling
Best Practices in Exception Handling
 
Identifying and Managing Technical Debt
Identifying and Managing Technical DebtIdentifying and Managing Technical Debt
Identifying and Managing Technical Debt
 
Pharo Networking by Example
Pharo Networking by ExamplePharo Networking by Example
Pharo Networking by Example
 
Music With Pharo
Music With PharoMusic With Pharo
Music With Pharo
 
Từ Gà Đến Pro Git và GitHub trong 60 phút
Từ Gà Đến Pro Git và GitHub trong 60 phútTừ Gà Đến Pro Git và GitHub trong 60 phút
Từ Gà Đến Pro Git và GitHub trong 60 phút
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Advanced JIRA and Confluence
Advanced JIRA and ConfluenceAdvanced JIRA and Confluence
Advanced JIRA and Confluence
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Embedded Systems: Lecture 1: Course Overview
Embedded Systems: Lecture 1: Course OverviewEmbedded Systems: Lecture 1: Course Overview
Embedded Systems: Lecture 1: Course Overview
 
Intégration de SonarQube dans GitLab ci
Intégration de SonarQube dans GitLab ciIntégration de SonarQube dans GitLab ci
Intégration de SonarQube dans GitLab ci
 
Fast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible JavaFast as C: How to Write Really Terrible Java
Fast as C: How to Write Really Terrible Java
 
Git and github
Git and githubGit and github
Git and github
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 

Semelhante a Improving Pharo Snapshots

Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented ParadigmHüseyin Ergin
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018Mike Harris
 
Unbreaking Your Django Application
Unbreaking Your Django ApplicationUnbreaking Your Django Application
Unbreaking Your Django ApplicationOSCON Byrum
 
CPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramCPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramMichael Heron
 
CPP13 - Object Orientation
CPP13 - Object OrientationCPP13 - Object Orientation
CPP13 - Object OrientationMichael Heron
 
How to interactively visualise and explore a billion objects (wit vaex)
How to interactively visualise and explore a billion objects (wit vaex)How to interactively visualise and explore a billion objects (wit vaex)
How to interactively visualise and explore a billion objects (wit vaex)Ali-ziane Myriam
 
Object Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - EncapsulationObject Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - EncapsulationChihyang Li
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...Terrance Cohen
 
Deep learning introduction
Deep learning introductionDeep learning introduction
Deep learning introductionAdwait Bhave
 
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuire
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuireEmbracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuire
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuireDatabricks
 
Alternative Approach to Plone Theming
Alternative Approach to Plone ThemingAlternative Approach to Plone Theming
Alternative Approach to Plone ThemingStefan Antonelli
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....Mike Harris
 
.NET UY Meetup 7 - CLR Memory by Fabian Alves
.NET UY Meetup 7 - CLR Memory by Fabian Alves.NET UY Meetup 7 - CLR Memory by Fabian Alves
.NET UY Meetup 7 - CLR Memory by Fabian Alves.NET UY Meetup
 
rsec2a-2016-jheaton-morning
rsec2a-2016-jheaton-morningrsec2a-2016-jheaton-morning
rsec2a-2016-jheaton-morningJeff Heaton
 
Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator ProgramGoDataDriven
 
Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)Carl Brown
 

Semelhante a Improving Pharo Snapshots (20)

Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented Paradigm
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
 
Introduction to c ++ part -1
Introduction to c ++   part -1Introduction to c ++   part -1
Introduction to c ++ part -1
 
Unbreaking Your Django Application
Unbreaking Your Django ApplicationUnbreaking Your Django Application
Unbreaking Your Django Application
 
CPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramCPP02 - The Structure of a Program
CPP02 - The Structure of a Program
 
CPP13 - Object Orientation
CPP13 - Object OrientationCPP13 - Object Orientation
CPP13 - Object Orientation
 
How to interactively visualise and explore a billion objects (wit vaex)
How to interactively visualise and explore a billion objects (wit vaex)How to interactively visualise and explore a billion objects (wit vaex)
How to interactively visualise and explore a billion objects (wit vaex)
 
Vaex talk-pydata-paris
Vaex talk-pydata-parisVaex talk-pydata-paris
Vaex talk-pydata-paris
 
Object Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - EncapsulationObject Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - Encapsulation
 
onGameStart
onGameStartonGameStart
onGameStart
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
 
Deep learning introduction
Deep learning introductionDeep learning introduction
Deep learning introduction
 
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuire
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuireEmbracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuire
Embracing a Taxonomy of Types to Simplify Machine Learning with Leah McGuire
 
Alternative Approach to Plone Theming
Alternative Approach to Plone ThemingAlternative Approach to Plone Theming
Alternative Approach to Plone Theming
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
 
.NET UY Meetup 7 - CLR Memory by Fabian Alves
.NET UY Meetup 7 - CLR Memory by Fabian Alves.NET UY Meetup 7 - CLR Memory by Fabian Alves
.NET UY Meetup 7 - CLR Memory by Fabian Alves
 
rsec2a-2016-jheaton-morning
rsec2a-2016-jheaton-morningrsec2a-2016-jheaton-morning
rsec2a-2016-jheaton-morning
 
Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator Program
 
Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)
 

Mais de 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
 

Mais de 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
 

Último

tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
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 AidPhilip Schwarz
 

Último (20)

tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
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
 

Improving Pharo Snapshots

  • 1. Improving Pharo Snapshots P. Tesone - G. Polito - N. Palumbo - ESUG’22 @tesonep @guillep @noTwitter guillermo.polito@univ-lille.fr pablo.tesone@inria.fr nahuel.palumbo@inria.fr
  • 3. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Everythingis an Object
  • 4. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Everythingis an Object
  • 5. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Everythingis an Object
  • 6. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Everythingis an Object
  • 7. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Everythingis an Object
  • 8. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Lots of Objects
  • 9. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Lots of Objects Lots of Stress
  • 10. • GC Stress • Autocompletion Stress • Search Stress • Spotter Stress • Startup Stress Lots of Objects Lots of Stress
  • 11. Large Image Support • https://github.com/pharo-project/largeImages • MIT Licenced
  • 12. Large Image Support: Highlights • Generator based searches • Spotter • Code Completion • GC Fine Tuning API generator ^ generator ifNil: [ generator := Generator on: [ :g | self entriesDo: [ :entry | (self acceptsEntry: entry) ifTrue: [ g yield: entry ] ] ] ]
  • 13. GC Fine Tuning • Con fi gure • Eden Size • Full GC Ratio • Growth Headroom • Shrink Threshold GCConfiguration readFromVM fullGCRatio: 1.0; activeDuring: [ “something" ].
  • 14. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Lots of Objects
  • 15. • Numbers • Characters • Strings • Arrays • Closures • Classes • Methods • … Images = Heap Snapshots .image save load Heap
  • 16. Snapshot Current Design Points • Bootstrap once, then mutate • Portable • Object References are pointers • Load code • Create Objects • Run your app • Maybe GC! • Repeat .image .image Heap
  • 17. But it could be better… • VM startup is bound by disk! • Large heaps take long to load/save • 3-4GB heaps = seconds to GC • pauses • long pauses • Load code • Create Objects • Run your app • Maybe GC! • Repeat .image .image Heap
  • 18. Snapshots vs Runtime Memory Mismatch App and System Objects Threads State as Objects JIT Machine Code Thread Stacks New Objects Old Objects .image
  • 19. Current Loading Snapshot to Memory JIT Machine Code Thread Stacks New Objects Old Objects Direct Mapping Rebuild Empty Empty .image App and System Objects Threads State as Objects Start with a cold VM, startup is slow
  • 20. Reference Swizzling • Traverse the heap to remap old references by delta • Slow for large heaps (2/4GB) Hot Methods Machine Code Process 1 Thread Stacks New Objects Old Objects Hot Methods Machine Code Process 2 Thread Stacks New Objects Old Objects R e m a p p e d delta
  • 21. Current Snapshot to Disk JIT Machine Code Thread Stacks New Objects Old Objects App and System Objects Threads State as Objects .image
  • 22. Current Snapshot to Disk JIT Machine Code Thread Stacks New Objects Old Objects 1.Discard App and System Objects Threads State as Objects .image
  • 23. JIT Machine Code Thread Stacks New Objects Old Objects 1.Discard 2. Save as objects App and System Objects Threads State as Objects .image Current Snapshot to Disk
  • 24. JIT Machine Code Thread Stacks New Objects Old Objects 1.Discard 2. Save as objects 3. Promote to old App and System Objects Threads State as Objects .image Current Snapshot to Disk
  • 25. JIT Machine Code Thread Stacks New Objects Old Objects 1.Discard 2. Save as objects 3. Promote to old 4. Save to Disk App and System Objects Threads State as Objects .image Current Snapshot to Disk
  • 26. JIT Machine Code Thread Stacks New Objects Old Objects 1.Discard 2. Save as objects 3. Promote to old 4. Save to Disk Discards all optimisations: slow shutdown => slow startup App and System Objects Threads State as Objects .image Current Snapshot to Disk
  • 27. Goals • Faster loading • Faster snapshot • Faster Multi-GB Heaps • Load code • Create Objects • Run your app • Maybe GC! • Repeat .image .image Heap
  • 28. Towards a Multi-file Snapshot Format JIT Machine Code Thread Stacks New Objects Old Objects JIT Machine Code Thread Stacks New Objects Old Objects Direct Mapping .image • System memory mapping • Minimize Swizzling • Lazy loading of memory segments
  • 29. Multiple Memory Segments JIT Machine Code Thread Stacks New Objects Old Objects JIT Machine Code Thread Stacks New Objects Old Objects Direct Mapping .image • Independently and lazy loadable • Independently storable Old Objects’ Old Objects’
  • 30. New Memory Segments JIT Machine Code Thread Stacks New Objects Old Objects JIT Machine Code Thread Stacks New Objects Old Objects Direct Mapping .image • Reduced garbage collection pressure • Great for opaque objects, and rarely changing objects (code, literals…) Perm Objects Perm Objects
  • 32. Separating Permanent Objects • Permanent objects are roots • But not all of them are roots • We don’t want to iterate all permanent objects!
  • 33. Maintaining a Remembered Set • Get the real roots in a remembered set • Updated with a write barrier and cleaned at GC
  • 35. Bad Semi-permanent Object Selection Worst case: all permanent are remembered (!!)
  • 36. What objects should be permanent?
  • 37. What objects should be permanent? How to minimise remembered objects?
  • 38. Pitfalls of Semi-permanent Object Selection • The remembered set can explode easily. E.g., • Objects that reference nil, true, false are always remembered • If you make a class permanent • => you probably want to make its method dictionary too • => and its methods, and literals • => and …
  • 39. Potential: GC cut by half • For production Apps! • Some Heuristics: • Code (+related) is semi-permanent • Collections go with their inner array • Association values are not (!!) Relative Speedups
  • 40. Automatic Object Selection via Simulations • Estimate • permanent segment size • remembered set size • Understand the leaking reasons • And extract better heuristics for production code (e.g., better move all classes with all method dictionaries…)
  • 41. Future Perspectives • Sharing permanent immutable objects, copy on write • Scaling multi-process applications • Application-speci fi c permanent object selection JIT Machine Code Thread Stacks New Objects Old Objects Perm Objects JIT Machine Code Thread Stacks New Objects Old Objects JIT Machine Code Thread Stacks New Objects Old Objects
  • 42. We are hiring! • We have • Engineer Positions • Phd Positions • Keywords: Compilers, Interpreters, Memory Management, Security • Come talk to us! 42
  • 43. Conclusion • Multi- fi le snapshot format • Permanent Objects and Selection • 2x GC improvements • Load code • Create Objects • Run your app • Maybe GC! • Repeat .image .image JIT Machine Code Thread Stacks New Objects Old Objects Perm Objects Relative Speedups