SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Zero-Overhead Metaprogramming
Using Self-Optimizing Interpreters to Remove the
Runtime Cost of Reflective Programming
Stefan Marr, INRIA Lille
Research collaboration with Chris Seaton, Oracle Labs
and Stéphane Ducasse, INRIA Lille___
PLDI, June 17, 2015
Runtime Metaprogramming
==
Just Another Form of Late Binding
 Optimized as Such
2
Zero-Overhead Metaprogramming
Using Self-Optimizing Interpreters to Remove the
Runtime Cost of Reflective Programming
Stefan Marr, INRIA Lille
Research collaboration with Chris Seaton, Oracle Labs
and Stéphane Ducasse, INRIA Lille___
PLDI, June 17, 2015
Runtime Metaprogramming
4
class Proxy
def method_missing(name, *args, &block)
target.send(name, *args, &block)
end
end
obj.invoke('foo', [])
obj.getField(idx)
obj.setField(idx, val)
Powerful and Useful
Frameworks, Domain-Specific Languages, …
Metaobject Protocol Example
Building a Safe Actor Framework
class ActorDomain : Domain {
fn writeToField(obj, fieldIdx, value) {
if (Domain.current() == this) {
obj.setField(fieldIdx, value);
} else {
throw new IsolationError(obj);
}
}
/* ... */
}
5
http://stefan-marr.de/research/omop/
Metaprogramming is slooow!
6
meth.invoke() 0.7x Overhead
Dynamic Proxies 6.5x Overhead
Everybody Knows:
Runtime
Metaprogramming is slooow!
7
OPTIMIZING REFLECTIVE OPERATIONS
8
obj.invoke('foo', [])
obj.getField(idx)
obj.setField(idx, val)
Method Invocation, Field Accesses, …
Reflective Method Invocation
9
cnt.invoke('+', [1])
How to optimize this?
Optimize Direct Invocation
10
cnt + 1
Hölzle, Chambers, Ungar, ’91.
cnt.+(1)
is polymorphic
-> Cache at Send Site
Solution: Polymorphic Inline Cache
• Avoids lookup
• Enables JIT to
inline
Generalize Polymorphic Inline Caches
to Dispatch Chains
11
cnt 1
invocation
read var literal
+
dispatch chain
dispatch
method
cnt.+(1)
Common Place in Self-Optimizing Interpreters:
Würthinger et al. [2012], Humer et al. [2014], Wöß et al. [2014]
Chain Nodes can have
arbitrary behavior
Dispatch Chain for Method Invocation
12
Un
Init
cnt: 0 (Integer object)
+ int ++
check class==int
true
false
Un
Init
Cache
Node
cnt.+(1)
• Avoids lookup
• Enables inlining
int
Reflective Method Invocation
13
cnt.invoke('+', [1])
How to optimize this?
Optimizing Reflective Method Invocation
14
cnt.invoke('+', [1])
'+
UnIn
Invoke
Node
cnt [1]
dispatch chain
on method name
Name
Node
15
UnIn
method
dispatch chain
dispatch
method
dispatch chain
on method name
Optimizing Reflective Method Invocation
cnt.invoke('+', [1])
'+'
Invoke
Node
cnt [1]
'+'
check name=='+'
true
false
nesting of dispatch
chains
resolves variability
Simple Metaprogramming Solved!
16
class Proxy
def method_missing(name, *args, &block)
target.send(name, *args, &block)
end
end
obj.invoke('foo', [])
obj.getField(idx)
obj.setField(idx, val) ✔
✔
Metaobject Protocol Example
Building a Safe Actor Framework
class ActorDomain : Domain {
fn writeToField(obj, fieldIdx, value) {
if (Domain.current() == this) {
obj.setField(fieldIdx, value);
} else {
throw new IsolationError(obj);
}
}
/* ... */
}
17
http://stefan-marr.de/research/omop/
An Actor Example
18
actor.fieldA := 1
actor
.fieldA :=
1
temp variable
read
literal
field write semantic depends
on metaobject
Dispatch Chains to Resolve Variability
19
field write
UnIn
dispatch chain
on metaobject
CacheMObj.fieldA := ActorDomain.
writeToField()
Intercession
handler
Dispatch Chains to Resolve Variability
20
field write
UnIn
dispatch chain
on metaobject
CacheMObj.fieldA :=
Shortcut for standard semantics
ActorDomain.
writeToField()
Intercession
handler
StdDomain StdWrite
Standard
direct write
DOES IT WORK?
Is it fast?
21
Evaluation: Self-Optimizing Interpreters
Academic “Simplicity”
Verify idea independent of
compilation technique
• Meta-Tracing (RPython)
• Partial Evaluation (Truffle)
Industrial “Sophistication”
High-Performance Truffle Backend
for JRuby
• Case Study with Production
Code
22
http://som-st.github.io
+Truffle
https://github.com/jruby/jruby/wiki/Truffle
Simple Metaprogramming: Zero Overhead
23
http://stefan-marr.de/papers/pldi-marr-et-al-zero-overhead-metaprogramming-artifacts/
Production Code: Image Processing
24
●
●
●
●
●
10.0
12.5
15.0
17.5
20.0
ComposeColorBurn
ComposeColorDodge
ComposeDarken
ComposeDifference
ComposeExclusion
ComposeHardLight
ComposeHardMix
ComposeLighten
ComposeLinearBurn
ComposeLinearDodge
ComposeLinearLight
ComposeMultiply
ComposeNormal
ComposeOverlay
ComposePinLight
ComposeScreen
ComposeSoftLight
ComposeVividLight
Speedupoverunoptimized
(higherisbetter)
+Truffle
Speedupoverunoptimized
(higherisbetter)
OMOP Overhead
25
meta-tracing partial evaluation
Overhead: 4% (min. -1%, max. 19%) Overhead: 9% (min. -7%, max. 38%)
●
●
●●●●
●
●
●●
●
●●
●
●
●
●●●●●
●
●
●●
●●
●●
●
●●●●●●
●●
●●●●●
●
●●●●●●
●●●●
●●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●●●
●
●●●
●●
●●●●
●
●●●
●
●●●●
●●●●
●
●
●
●●●●●●
●●●
●●●
●
●●●●●
●●●
●●●
●●●●
●●●●
●
●●●●
●●
●●
●
●
●●
●
●
●●●
1.00
1.05
1.10
1.15
1.20
Bounce
BubbleSort
Dispatch
Fannkuch
Fibonacci
FieldLoop
IntegerLoop
List
Loop
Permute
QuickSort
Recurse
Storage
Sum
Towers
TreeSort
WhileLoop
DeltaBlue
Mandelbrot
NBody
Richards
RuntimeRatiotorunwithoutOMOP
SOMMT
●●●●●●●●●●●●●●●●●●●●●●●●●●
●
●●●●●●●●●●●●●●●●●●●●●●
0.8
1.0
1.2
1.4
Bounce
BubbleSort
Dispatch
Fannkuch
Fibonacci
FieldLoop
IntegerLoop
List
Loop
Permute
QuickSort
Recurse
Storage
Sum
Towers
TreeSort
WhileLoop
DeltaBlue
Mandelbrot
NBody
Richards
RuntimeRatiotorunwithoutOMOP
SOMPE
Open Research Questions
• Do programs with MOPs have classic trimodal
distribution of send-site polymorphism?
– i.e. does basic PIC hypothesis apply?
– Same polymorphism degree, inlining limits, …
• How to implement dispatch chains efficiently
in classic tier JIT compilers?
26
Dispatch Chains: A Generalization of PICs
• Complete removal of reflective overhead
–Simple and sufficient
–For meta-tracing and partial evaluation
• Enables
–Zero-Overhead Metaprogramming
–efficient MOPs for smarter DSLs
27
dispatch chain
dispatch
method
Runtime Metaprogramming
==
Just Another Form of Late Binding
 Optimized as Such
28
+Truffle
http://stefan-marr.de/papers/pldi-marr-et-al-zero-overhead-metaprogramming/

Weitere ähnliche Inhalte

Was ist angesagt?

Accelerating Habanero-Java Program with OpenCL Generation
Accelerating Habanero-Java Program with OpenCL GenerationAccelerating Habanero-Java Program with OpenCL Generation
Accelerating Habanero-Java Program with OpenCL GenerationAkihiro Hayashi
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesTobias Lindaaker
 
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent ProgrammingTobias Lindaaker
 
To Swift 2...and Beyond!
To Swift 2...and Beyond!To Swift 2...and Beyond!
To Swift 2...and Beyond!Scott Gardner
 
Arduino C maXbox web of things slide show
Arduino C maXbox web of things slide showArduino C maXbox web of things slide show
Arduino C maXbox web of things slide showMax Kleiner
 
iOS Development with Blocks
iOS Development with BlocksiOS Development with Blocks
iOS Development with BlocksJeff Kelley
 
Конверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемыеКонверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемыеPlatonov Sergey
 
Introduction to Rust language programming
Introduction to Rust language programmingIntroduction to Rust language programming
Introduction to Rust language programmingRodolfo Finochietti
 
Seastar Summit 2019: Past and future of futures
Seastar Summit 2019: Past and future of futuresSeastar Summit 2019: Past and future of futures
Seastar Summit 2019: Past and future of futuresScyllaDB
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09Guy Korland
 
Engineering fast indexes (Deepdive)
Engineering fast indexes (Deepdive)Engineering fast indexes (Deepdive)
Engineering fast indexes (Deepdive)Daniel Lemire
 
Seeing with Python presented at PyCon AU 2014
Seeing with Python presented at PyCon AU 2014Seeing with Python presented at PyCon AU 2014
Seeing with Python presented at PyCon AU 2014Mark Rees
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesTeerawat Issariyakul
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...David Walker
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchMatteo Battaglio
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJSstefanmayer13
 

Was ist angesagt? (20)

Accelerating Habanero-Java Program with OpenCL Generation
Accelerating Habanero-Java Program with OpenCL GenerationAccelerating Habanero-Java Program with OpenCL Generation
Accelerating Habanero-Java Program with OpenCL Generation
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
 
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming
 
To Swift 2...and Beyond!
To Swift 2...and Beyond!To Swift 2...and Beyond!
To Swift 2...and Beyond!
 
bluespec talk
bluespec talkbluespec talk
bluespec talk
 
Arduino C maXbox web of things slide show
Arduino C maXbox web of things slide showArduino C maXbox web of things slide show
Arduino C maXbox web of things slide show
 
iOS Development with Blocks
iOS Development with BlocksiOS Development with Blocks
iOS Development with Blocks
 
Конверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемыеКонверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемые
 
Introduction to Rust language programming
Introduction to Rust language programmingIntroduction to Rust language programming
Introduction to Rust language programming
 
Seastar Summit 2019: Past and future of futures
Seastar Summit 2019: Past and future of futuresSeastar Summit 2019: Past and future of futures
Seastar Summit 2019: Past and future of futures
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09
 
Engineering fast indexes (Deepdive)
Engineering fast indexes (Deepdive)Engineering fast indexes (Deepdive)
Engineering fast indexes (Deepdive)
 
Seeing with Python presented at PyCon AU 2014
Seeing with Python presented at PyCon AU 2014Seeing with Python presented at PyCon AU 2014
Seeing with Python presented at PyCon AU 2014
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variables
 
同態加密
同態加密同態加密
同態加密
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
 
Blazing Fast Windows 8 Apps using Visual C++
Blazing Fast Windows 8 Apps using Visual C++Blazing Fast Windows 8 Apps using Visual C++
Blazing Fast Windows 8 Apps using Visual C++
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
 
Return of c++
Return of c++Return of c++
Return of c++
 

Ähnlich wie Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and without Compromises (PLDI 2015)

Static code analysis: what? how? why?
Static code analysis: what? how? why?Static code analysis: what? how? why?
Static code analysis: what? how? why?Andrey Karpov
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHoward Lewis Ship
 
.NET 7 Performance Improvements_10_03_2023.pdf
.NET 7 Performance Improvements_10_03_2023.pdf.NET 7 Performance Improvements_10_03_2023.pdf
.NET 7 Performance Improvements_10_03_2023.pdfMirco Vanini
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Andreas Dewes
 
Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The LandingHaci Murat Yaman
 
TensorFlow Lite (r1.5) & Android 8.1 Neural Network API
TensorFlow Lite (r1.5) & Android 8.1 Neural Network APITensorFlow Lite (r1.5) & Android 8.1 Neural Network API
TensorFlow Lite (r1.5) & Android 8.1 Neural Network APIMr. Vengineer
 
Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded cBenux Wei
 
Node.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizationsNode.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizationsDawid Rusnak
 
What's new in Python 3.11
What's new in Python 3.11What's new in Python 3.11
What's new in Python 3.11Henry Schreiner
 
05. Java Loops Methods and Classes
05. Java Loops Methods and Classes05. Java Loops Methods and Classes
05. Java Loops Methods and ClassesIntro C# Book
 
Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...
Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...
Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...Stefan Marr
 
C++11: Feel the New Language
C++11: Feel the New LanguageC++11: Feel the New Language
C++11: Feel the New Languagemspline
 
Cross Platform App Development with C++
Cross Platform App Development with C++Cross Platform App Development with C++
Cross Platform App Development with C++Joan Puig Sanz
 

Ähnlich wie Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and without Compromises (PLDI 2015) (20)

Static code analysis: what? how? why?
Static code analysis: what? how? why?Static code analysis: what? how? why?
Static code analysis: what? how? why?
 
обзор Python
обзор Pythonобзор Python
обзор Python
 
Dlr
DlrDlr
Dlr
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
 
.NET 7 Performance Improvements_10_03_2023.pdf
.NET 7 Performance Improvements_10_03_2023.pdf.NET 7 Performance Improvements_10_03_2023.pdf
.NET 7 Performance Improvements_10_03_2023.pdf
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...
 
Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The Landing
 
TensorFlow Lite (r1.5) & Android 8.1 Neural Network API
TensorFlow Lite (r1.5) & Android 8.1 Neural Network APITensorFlow Lite (r1.5) & Android 8.1 Neural Network API
TensorFlow Lite (r1.5) & Android 8.1 Neural Network API
 
Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded c
 
Node.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizationsNode.js behind: V8 and its optimizations
Node.js behind: V8 and its optimizations
 
What's new in Python 3.11
What's new in Python 3.11What's new in Python 3.11
What's new in Python 3.11
 
Tdd,Ioc
Tdd,IocTdd,Ioc
Tdd,Ioc
 
05. Java Loops Methods and Classes
05. Java Loops Methods and Classes05. Java Loops Methods and Classes
05. Java Loops Methods and Classes
 
Getting Input from User
Getting Input from UserGetting Input from User
Getting Input from User
 
Unit-2 Getting Input from User.pptx
Unit-2 Getting Input from User.pptxUnit-2 Getting Input from User.pptx
Unit-2 Getting Input from User.pptx
 
Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...
Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...
Metaprogramming, Metaobject Protocols, Gradual Type Checks: Optimizing the "U...
 
Python_Unit_2 OOPS.pptx
Python_Unit_2  OOPS.pptxPython_Unit_2  OOPS.pptx
Python_Unit_2 OOPS.pptx
 
C++11: Feel the New Language
C++11: Feel the New LanguageC++11: Feel the New Language
C++11: Feel the New Language
 
Cross Platform App Development with C++
Cross Platform App Development with C++Cross Platform App Development with C++
Cross Platform App Development with C++
 

Mehr von Stefan Marr

Seminar on Parallel and Concurrent Programming
Seminar on Parallel and Concurrent ProgrammingSeminar on Parallel and Concurrent Programming
Seminar on Parallel and Concurrent ProgrammingStefan Marr
 
Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...
Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...
Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...Stefan Marr
 
Why Is Concurrent Programming Hard? And What Can We Do about It?
Why Is Concurrent Programming Hard? And What Can We Do about It?Why Is Concurrent Programming Hard? And What Can We Do about It?
Why Is Concurrent Programming Hard? And What Can We Do about It?Stefan Marr
 
Cloud PARTE: Elastic Complex Event Processing based on Mobile Actors
Cloud PARTE: Elastic Complex Event Processing based on Mobile ActorsCloud PARTE: Elastic Complex Event Processing based on Mobile Actors
Cloud PARTE: Elastic Complex Event Processing based on Mobile ActorsStefan Marr
 
Supporting Concurrency Abstractions in High-level Language Virtual Machines
Supporting Concurrency Abstractions in High-level Language Virtual MachinesSupporting Concurrency Abstractions in High-level Language Virtual Machines
Supporting Concurrency Abstractions in High-level Language Virtual MachinesStefan Marr
 
Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...
Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...
Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...Stefan Marr
 
Sly and the RoarVM: Parallel Programming with Smalltalk
Sly and the RoarVM: Parallel Programming with SmalltalkSly and the RoarVM: Parallel Programming with Smalltalk
Sly and the RoarVM: Parallel Programming with SmalltalkStefan Marr
 
Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...
Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...
Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...Stefan Marr
 
Sly and the RoarVM: Exploring the Manycore Future of Programming
Sly and the RoarVM: Exploring the Manycore Future of ProgrammingSly and the RoarVM: Exploring the Manycore Future of Programming
Sly and the RoarVM: Exploring the Manycore Future of ProgrammingStefan Marr
 
PHP.next: Traits
PHP.next: TraitsPHP.next: Traits
PHP.next: TraitsStefan Marr
 
The Price of the Free Lunch: Programming in the Multicore Era
The Price of the Free Lunch: Programming in the Multicore EraThe Price of the Free Lunch: Programming in the Multicore Era
The Price of the Free Lunch: Programming in the Multicore EraStefan Marr
 
Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...
Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...
Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...Stefan Marr
 
Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...
Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...
Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...Stefan Marr
 
Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...
Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...
Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...Stefan Marr
 
Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...
Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...
Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...Stefan Marr
 
Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...
Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...
Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...Stefan Marr
 
VMADL: An Architecture Definition Language for Variability and Composition ...
VMADL: An Architecture Definition Language  for Variability and Composition  ...VMADL: An Architecture Definition Language  for Variability and Composition  ...
VMADL: An Architecture Definition Language for Variability and Composition ...Stefan Marr
 
Metaprogrammierung und Reflection
Metaprogrammierung und ReflectionMetaprogrammierung und Reflection
Metaprogrammierung und ReflectionStefan Marr
 
Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?Stefan Marr
 

Mehr von Stefan Marr (19)

Seminar on Parallel and Concurrent Programming
Seminar on Parallel and Concurrent ProgrammingSeminar on Parallel and Concurrent Programming
Seminar on Parallel and Concurrent Programming
 
Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...
Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...
Tracing versus Partial Evaluation: Which Meta-Compilation Approach is Better ...
 
Why Is Concurrent Programming Hard? And What Can We Do about It?
Why Is Concurrent Programming Hard? And What Can We Do about It?Why Is Concurrent Programming Hard? And What Can We Do about It?
Why Is Concurrent Programming Hard? And What Can We Do about It?
 
Cloud PARTE: Elastic Complex Event Processing based on Mobile Actors
Cloud PARTE: Elastic Complex Event Processing based on Mobile ActorsCloud PARTE: Elastic Complex Event Processing based on Mobile Actors
Cloud PARTE: Elastic Complex Event Processing based on Mobile Actors
 
Supporting Concurrency Abstractions in High-level Language Virtual Machines
Supporting Concurrency Abstractions in High-level Language Virtual MachinesSupporting Concurrency Abstractions in High-level Language Virtual Machines
Supporting Concurrency Abstractions in High-level Language Virtual Machines
 
Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...
Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...
Identifying A Unifying Mechanism for the Implementation of Concurrency Abstra...
 
Sly and the RoarVM: Parallel Programming with Smalltalk
Sly and the RoarVM: Parallel Programming with SmalltalkSly and the RoarVM: Parallel Programming with Smalltalk
Sly and the RoarVM: Parallel Programming with Smalltalk
 
Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...
Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...
Which Problems Does a Multi-Language Virtual Machine Need to Solve in the Mul...
 
Sly and the RoarVM: Exploring the Manycore Future of Programming
Sly and the RoarVM: Exploring the Manycore Future of ProgrammingSly and the RoarVM: Exploring the Manycore Future of Programming
Sly and the RoarVM: Exploring the Manycore Future of Programming
 
PHP.next: Traits
PHP.next: TraitsPHP.next: Traits
PHP.next: Traits
 
The Price of the Free Lunch: Programming in the Multicore Era
The Price of the Free Lunch: Programming in the Multicore EraThe Price of the Free Lunch: Programming in the Multicore Era
The Price of the Free Lunch: Programming in the Multicore Era
 
Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...
Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...
Locality and Encapsulation: A Foundation for Concurrency Support in Multi-Lan...
 
Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...
Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...
Insertion Tree Phasers: Efficient and Scalable Barrier Synchronization for Fi...
 
Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...
Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...
Encapsulation and Locality: A Foundation for Concurrency Support in Multi-Lan...
 
Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...
Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...
Intermediate Language Design of High-level Language VMs: Towards Comprehensiv...
 
Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...
Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...
Virtual Machine Support for Many-Core Architectures: Decoupling Abstract from...
 
VMADL: An Architecture Definition Language for Variability and Composition ...
VMADL: An Architecture Definition Language  for Variability and Composition  ...VMADL: An Architecture Definition Language  for Variability and Composition  ...
VMADL: An Architecture Definition Language for Variability and Composition ...
 
Metaprogrammierung und Reflection
Metaprogrammierung und ReflectionMetaprogrammierung und Reflection
Metaprogrammierung und Reflection
 
Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?
 

Kürzlich hochgeladen

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and without Compromises (PLDI 2015)

  • 1. Zero-Overhead Metaprogramming Using Self-Optimizing Interpreters to Remove the Runtime Cost of Reflective Programming Stefan Marr, INRIA Lille Research collaboration with Chris Seaton, Oracle Labs and Stéphane Ducasse, INRIA Lille___ PLDI, June 17, 2015
  • 2. Runtime Metaprogramming == Just Another Form of Late Binding  Optimized as Such 2
  • 3. Zero-Overhead Metaprogramming Using Self-Optimizing Interpreters to Remove the Runtime Cost of Reflective Programming Stefan Marr, INRIA Lille Research collaboration with Chris Seaton, Oracle Labs and Stéphane Ducasse, INRIA Lille___ PLDI, June 17, 2015
  • 4. Runtime Metaprogramming 4 class Proxy def method_missing(name, *args, &block) target.send(name, *args, &block) end end obj.invoke('foo', []) obj.getField(idx) obj.setField(idx, val) Powerful and Useful Frameworks, Domain-Specific Languages, …
  • 5. Metaobject Protocol Example Building a Safe Actor Framework class ActorDomain : Domain { fn writeToField(obj, fieldIdx, value) { if (Domain.current() == this) { obj.setField(fieldIdx, value); } else { throw new IsolationError(obj); } } /* ... */ } 5 http://stefan-marr.de/research/omop/
  • 6. Metaprogramming is slooow! 6 meth.invoke() 0.7x Overhead Dynamic Proxies 6.5x Overhead
  • 8. OPTIMIZING REFLECTIVE OPERATIONS 8 obj.invoke('foo', []) obj.getField(idx) obj.setField(idx, val) Method Invocation, Field Accesses, …
  • 10. Optimize Direct Invocation 10 cnt + 1 Hölzle, Chambers, Ungar, ’91. cnt.+(1) is polymorphic -> Cache at Send Site Solution: Polymorphic Inline Cache • Avoids lookup • Enables JIT to inline
  • 11. Generalize Polymorphic Inline Caches to Dispatch Chains 11 cnt 1 invocation read var literal + dispatch chain dispatch method cnt.+(1) Common Place in Self-Optimizing Interpreters: Würthinger et al. [2012], Humer et al. [2014], Wöß et al. [2014] Chain Nodes can have arbitrary behavior
  • 12. Dispatch Chain for Method Invocation 12 Un Init cnt: 0 (Integer object) + int ++ check class==int true false Un Init Cache Node cnt.+(1) • Avoids lookup • Enables inlining int
  • 14. Optimizing Reflective Method Invocation 14 cnt.invoke('+', [1]) '+ UnIn Invoke Node cnt [1] dispatch chain on method name
  • 15. Name Node 15 UnIn method dispatch chain dispatch method dispatch chain on method name Optimizing Reflective Method Invocation cnt.invoke('+', [1]) '+' Invoke Node cnt [1] '+' check name=='+' true false nesting of dispatch chains resolves variability
  • 16. Simple Metaprogramming Solved! 16 class Proxy def method_missing(name, *args, &block) target.send(name, *args, &block) end end obj.invoke('foo', []) obj.getField(idx) obj.setField(idx, val) ✔ ✔
  • 17. Metaobject Protocol Example Building a Safe Actor Framework class ActorDomain : Domain { fn writeToField(obj, fieldIdx, value) { if (Domain.current() == this) { obj.setField(fieldIdx, value); } else { throw new IsolationError(obj); } } /* ... */ } 17 http://stefan-marr.de/research/omop/
  • 18. An Actor Example 18 actor.fieldA := 1 actor .fieldA := 1 temp variable read literal field write semantic depends on metaobject
  • 19. Dispatch Chains to Resolve Variability 19 field write UnIn dispatch chain on metaobject CacheMObj.fieldA := ActorDomain. writeToField() Intercession handler
  • 20. Dispatch Chains to Resolve Variability 20 field write UnIn dispatch chain on metaobject CacheMObj.fieldA := Shortcut for standard semantics ActorDomain. writeToField() Intercession handler StdDomain StdWrite Standard direct write
  • 21. DOES IT WORK? Is it fast? 21
  • 22. Evaluation: Self-Optimizing Interpreters Academic “Simplicity” Verify idea independent of compilation technique • Meta-Tracing (RPython) • Partial Evaluation (Truffle) Industrial “Sophistication” High-Performance Truffle Backend for JRuby • Case Study with Production Code 22 http://som-st.github.io +Truffle https://github.com/jruby/jruby/wiki/Truffle
  • 23. Simple Metaprogramming: Zero Overhead 23 http://stefan-marr.de/papers/pldi-marr-et-al-zero-overhead-metaprogramming-artifacts/
  • 24. Production Code: Image Processing 24 ● ● ● ● ● 10.0 12.5 15.0 17.5 20.0 ComposeColorBurn ComposeColorDodge ComposeDarken ComposeDifference ComposeExclusion ComposeHardLight ComposeHardMix ComposeLighten ComposeLinearBurn ComposeLinearDodge ComposeLinearLight ComposeMultiply ComposeNormal ComposeOverlay ComposePinLight ComposeScreen ComposeSoftLight ComposeVividLight Speedupoverunoptimized (higherisbetter) +Truffle Speedupoverunoptimized (higherisbetter)
  • 25. OMOP Overhead 25 meta-tracing partial evaluation Overhead: 4% (min. -1%, max. 19%) Overhead: 9% (min. -7%, max. 38%) ● ● ●●●● ● ● ●● ● ●● ● ● ● ●●●●● ● ● ●● ●● ●● ● ●●●●●● ●● ●●●●● ● ●●●●●● ●●●● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●●● ● ●●● ●● ●●●● ● ●●● ● ●●●● ●●●● ● ● ● ●●●●●● ●●● ●●● ● ●●●●● ●●● ●●● ●●●● ●●●● ● ●●●● ●● ●● ● ● ●● ● ● ●●● 1.00 1.05 1.10 1.15 1.20 Bounce BubbleSort Dispatch Fannkuch Fibonacci FieldLoop IntegerLoop List Loop Permute QuickSort Recurse Storage Sum Towers TreeSort WhileLoop DeltaBlue Mandelbrot NBody Richards RuntimeRatiotorunwithoutOMOP SOMMT ●●●●●●●●●●●●●●●●●●●●●●●●●● ● ●●●●●●●●●●●●●●●●●●●●●● 0.8 1.0 1.2 1.4 Bounce BubbleSort Dispatch Fannkuch Fibonacci FieldLoop IntegerLoop List Loop Permute QuickSort Recurse Storage Sum Towers TreeSort WhileLoop DeltaBlue Mandelbrot NBody Richards RuntimeRatiotorunwithoutOMOP SOMPE
  • 26. Open Research Questions • Do programs with MOPs have classic trimodal distribution of send-site polymorphism? – i.e. does basic PIC hypothesis apply? – Same polymorphism degree, inlining limits, … • How to implement dispatch chains efficiently in classic tier JIT compilers? 26
  • 27. Dispatch Chains: A Generalization of PICs • Complete removal of reflective overhead –Simple and sufficient –For meta-tracing and partial evaluation • Enables –Zero-Overhead Metaprogramming –efficient MOPs for smarter DSLs 27 dispatch chain dispatch method
  • 28. Runtime Metaprogramming == Just Another Form of Late Binding  Optimized as Such 28 +Truffle http://stefan-marr.de/papers/pldi-marr-et-al-zero-overhead-metaprogramming/

Hinweis der Redaktion

  1. - back????
  2. - back????
  3. - Perhaps change reference, other Kalibra?
  4. -- UnIn not clear -- whitespace
  5. SOM: depending on the variant: only 2x to 3x slow than Java, and the benchmarks we optimized within 3% range
  6. Use of runtime programming sneaks into all kind of places, including performance sensitive parts. This here is a ruby library to process photoshop files, we chose a number of kernels that do layer composition to show that optimizing reflective operations gives major benefits. This library is not artificial, it is widely used, and arguably, layer composition can be performance critical. It has more than 500 forks on GitHub…
  7. We had 50% overhead without VM support on PyPy
  8. - back????