SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
Multi-Dimensional
Execution Profiling
Alexandre Bergel
University of Chile, Chile
Saturday 13 November 2010
2
2009
2009
Saturday 13 November 2010
3
}
{
}
{
}
{
}
{
}
{
Saturday 13 November 2010
4
}
{
}
{
}
{
}
{
}
{
1.4
5.2
5.6
2.3
0.5
...
Saturday 13 November 2010
5
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
1.4
5.2
5.6
2.3
0.5
... Understanding why
Saturday 13 November 2010
6
Saturday 13 November 2010
7
Saturday 13 November 2010
8
2010
2010
Saturday 13 November 2010
gprof: flat profile
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
33.34 0.02 0.02 7208 0.00 0.00 open
16.67 0.03 0.01 244 0.04 0.12 offtime
16.67 0.04 0.01 8 1.25 1.25 memccpy
16.67 0.05 0.01 7 1.43 1.43 write
16.67 0.06 0.01 mcount
0.00 0.06 0.00 236 0.00 0.00 tzset
0.00 0.06 0.00 192 0.00 0.00 tolower
0.00 0.06 0.00 47 0.00 0.00 strlen
0.00 0.06 0.00 45 0.00 0.00 strchr
9
Saturday 13 November 2010
gprof: call graph (~1984)
index % time self children called name
<spontaneous>
[1] 100.0 0.00 0.05 start [1]
0.00 0.05 1/1 main [2]
0.00 0.00 1/2 on_exit [28]
0.00 0.00 1/1 exit [59]
-----------------------------------------------
0.00 0.05 1/1 start [1]
[2] 100.0 0.00 0.05 1 main [2]
0.00 0.05 1/1 report [3]
-----------------------------------------------
0.00 0.05 1/1 main [2]
[3] 100.0 0.00 0.05 1 report [3]
0.00 0.03 8/8 timelocal [6]
0.00 0.01 1/1 print [9]
0.00 0.01 9/9 fgets [12]
0.00 0.00 12/34 strncmp <cycle 1> [40]
0.00 0.00 8/8 lookup [20]
0.00 0.00 1/1 fopen [21]
0.00 0.00 8/8 chewtime [24]
0.00 0.00 8/16 skipspace [44]
-----------------------------------------------
[4] 59.8 0.01 0.02 8+472 <cycle 2 as a whole>! [4]
0.01 0.02 244+260 offtime <cycle 2> [7]
0.00 0.00 236+1 tzset <cycle 2> [26]
-----------------------------------------------
10
Saturday 13 November 2010
YourKit
11
Saturday 13 November 2010
YourKit
12
Saturday 13 November 2010
JProfiler
13
Saturday 13 November 2010
JProfiler
14
Saturday 13 November 2010
JProfiler
15
Saturday 13 November 2010
Retrospective on profiling
16
Information conveyed hasn’t evolved since gprof
Useful to understand what happened
But is of little help to understand why and how
Is there a “slow” function that is called too often?
What makes a function “slow”?
Saturday 13 November 2010
Roadmap
1.Polymetric views
2.Profiling Blueprint
3.Implementation
17
Saturday 13 November 2010
Polymetric view can map up to 5
dimensions
width property
height
property
color
property
X property
Y
property
18
[Lanza 2003]
Saturday 13 November 2010
19
KaiProfiler
viewProfiling: [
| view |
! view := MOViewRenderer new.
! view
nodes: (1 to: 100)
forEach: [:each |
view nodes: (1 to: 100)].
! view root applyLayout
! ]
Saturday 13 November 2010
Structural blueprint
legend for methods
(color)
#different
receiver
# executions
execution
time
20
Saturday 13 November 2010
Structural blueprint
legend for methods
(color)
#different
receiver
# executions
execution
time
bounds
21
Saturday 13 November 2010
Behavioral blueprint
legend for methods
gray =
return
self
yellow =
constant
on return
value
# executions
execution
time
m2
m1
invokes
m2 and m3
m1 m3
22
Saturday 13 November 2010
Behavioral blueprint
legend for methods
gray =
return
self
yellow =
constant
on return
value
# executions
execution
time
m2
m1
invokes
m2 and m3
m1 m3
bounds
23
Saturday 13 November 2010
Detailed behavioral blueprint
MOGraphElement>>
origin
shapeBoundsAt:ifPresent:
Called by #bounds
Calling #bounds
bounds
computeExtentHavingChildrenFor:
24
Saturday 13 November 2010
Code of the bounds method
MOGraphElement>>bounds
"Answer the bounds of the receiver."
| basicBounds |
self shapeBoundsAt: self shape ifPresent: [ :b | ^ b ].
basicBounds := shape computeBoundsFor: self.
self shapeBoundsAt: self shape put: basicBounds.
^ basicBounds
25
Saturday 13 November 2010
Memoizing
MOGraphElement>>bounds
"Answer the bounds of the receiver."
| basicBounds |
boundsCache ifNotNil: [ ^ boundsCache ].
self shapeBoundsAt: self shape ifPresent: [ :b | ^ b ].
basicBounds := shape computeBoundsFor: self.
self shapeBoundsAt: self shape put: basicBounds.
^ boundsCache := basicBounds
26
Saturday 13 November 2010
A
B
C
Upgrading
MOGraphElement>>bounds
27
Saturday 13 November 2010
A
B
C
Upgrading
MOGraphElement>>bounds
43%
speedup
28
Saturday 13 November 2010
B
A
Upgrading
MOGraphElement>>bounds
29
Saturday 13 November 2010
A
B C
cached
absoluteBounds
ins
A'
C'
B'
C'
30
Saturday 13 November 2010
A
B C D
cached
absoluteBounds
make display:on:
call absoluteBounds
instead of absoluteBoundsFor:
A'
C'
B'
C'
30
Saturday 13 November 2010
B C D
make display:on:
call absoluteBounds
instead of absoluteBoundsFor:
C'
B'
C'
30
Saturday 13 November 2010
Implementation
We use the following metrics:
execution time for a method (% and ms)
number of executions
number of different object receivers
Dynamic properties
a method performs a side effect
31
Saturday 13 November 2010
Naive (but effective) implementation
Code to profile is executed twice
using a sampling method to get the execution time
instrumentation to get all the remaining metrics
Use hash values to distinguish between different
receiver objects
Built a kind of AOP mechanism for the low level
instrumentation (the Spy framework)
32
Saturday 13 November 2010
Implementation techniques
Visualizations are generated using a scripting
languages
... in Mondrian
33
Saturday 13 November 2010
34
Saturday 13 November 2010
35
2011
2011
Saturday 13 November 2010
Behavioral blueprint
legend for methods
gray =
return
self
yellow =
constant
on return
value
# executions
execution
time
m2
m1
invokes
m2 and m3
m1 m3
36
Saturday 13 November 2010
37
0
100000000
200000000
300000000
400000000
0 10000 20000 30000 40000
times (ms)
message
sends
Counting messages instead of time
sampling
Saturday 13 November 2010
Counting messages: cache warming
38
0
7500
15000
22500
30000
0 10000 20000 30000 40000
times (ms)
MR
α,c
Saturday 13 November 2010
Counting messages per methods
39
times (ms)
number of
message sends
0
2500000
5000000
7500000
10000000
0 75 150 225 300
Saturday 13 November 2010
40
Differentiation profiling
Saturday 13 November 2010
Test coverage
41
Saturday 13 November 2010
Memory blueprint
42
MetacelloProject>>
currentVersion
MetacelloProject>>
sortedAndFilteredVersions
Saturday 13 November 2010
A
B
C
www.moosetechnology.org/tools/Spy
Alexandre Bergel, Romain Robbes,
Walter Binder
Thanks to Mariano, Fabian, Felipe, ...
abergel@dcc.uchile.cl
43
Saturday 13 November 2010

Contenu connexe

Tendances

computer notes - Data Structures - 9
computer notes - Data Structures - 9computer notes - Data Structures - 9
computer notes - Data Structures - 9
ecomputernotes
 

Tendances (19)

Javascript Array map method
Javascript Array map methodJavascript Array map method
Javascript Array map method
 
Ignite es6
Ignite es6Ignite es6
Ignite es6
 
Network Analysis with networkX : Real-World Example-1
Network Analysis with networkX : Real-World Example-1Network Analysis with networkX : Real-World Example-1
Network Analysis with networkX : Real-World Example-1
 
Demodulate bpsk up
Demodulate bpsk upDemodulate bpsk up
Demodulate bpsk up
 
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser BootsmaDSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
DSD-INT 2018 Work with iMOD MODFLOW models in Python - Visser Bootsma
 
Python programing
Python programingPython programing
Python programing
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in R
 
Functors, Comonads, and Digital Image Processing
Functors, Comonads, and Digital Image ProcessingFunctors, Comonads, and Digital Image Processing
Functors, Comonads, and Digital Image Processing
 
L2 binomial operations
L2 binomial operationsL2 binomial operations
L2 binomial operations
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocity
 
Generating and Analyzing Events
Generating and Analyzing EventsGenerating and Analyzing Events
Generating and Analyzing Events
 
SciSmalltalk: Doing Science with Agility
SciSmalltalk: Doing Science with AgilitySciSmalltalk: Doing Science with Agility
SciSmalltalk: Doing Science with Agility
 
computer notes - Data Structures - 9
computer notes - Data Structures - 9computer notes - Data Structures - 9
computer notes - Data Structures - 9
 
bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018
 
Modular Macros for OCaml
Modular Macros for OCamlModular Macros for OCaml
Modular Macros for OCaml
 
Stream
StreamStream
Stream
 
Program implementation and testing
Program implementation and testingProgram implementation and testing
Program implementation and testing
 
Lab 1 izz
Lab 1 izzLab 1 izz
Lab 1 izz
 
Date and Time Module in Python | Edureka
Date and Time Module in Python | EdurekaDate and Time Module in Python | Edureka
Date and Time Module in Python | Edureka
 

En vedette

En vedette (7)

2006 Small Scheme
2006 Small Scheme2006 Small Scheme
2006 Small Scheme
 
Profiling blueprints
Profiling blueprintsProfiling blueprints
Profiling blueprints
 
tres fotos
tres fotostres fotos
tres fotos
 
2006 Esug Omnibrowser
2006 Esug Omnibrowser2006 Esug Omnibrowser
2006 Esug Omnibrowser
 
Power Point
Power PointPower Point
Power Point
 
2006 Seaside
2006 Seaside2006 Seaside
2006 Seaside
 
2008 Sccc Smalltalk
2008 Sccc Smalltalk2008 Sccc Smalltalk
2008 Sccc Smalltalk
 

Similaire à Multi dimensional profiling

Seaside - Why should you care? (Dynamic Stockholm 2010)
Seaside - Why should you care? (Dynamic Stockholm 2010)Seaside - Why should you care? (Dynamic Stockholm 2010)
Seaside - Why should you care? (Dynamic Stockholm 2010)
jfitzell
 
Designing for garbage collection
Designing for garbage collectionDesigning for garbage collection
Designing for garbage collection
Gregg Donovan
 
Edge detection of video using matlab code
Edge detection of video using matlab codeEdge detection of video using matlab code
Edge detection of video using matlab code
Bhushan Deore
 
Derailed chef update-oct2010
Derailed chef update-oct2010Derailed chef update-oct2010
Derailed chef update-oct2010
jtimberman
 
Data driven app deploys with chef frontdev
Data driven app deploys with chef frontdevData driven app deploys with chef frontdev
Data driven app deploys with chef frontdev
jtimberman
 

Similaire à Multi dimensional profiling (20)

Rubinius - What Have You Done For Me Lately?
Rubinius - What Have You Done For Me Lately?Rubinius - What Have You Done For Me Lately?
Rubinius - What Have You Done For Me Lately?
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010
 
Seaside - Why should you care? (Dynamic Stockholm 2010)
Seaside - Why should you care? (Dynamic Stockholm 2010)Seaside - Why should you care? (Dynamic Stockholm 2010)
Seaside - Why should you care? (Dynamic Stockholm 2010)
 
openTSDB - Metrics for a distributed world
openTSDB - Metrics for a distributed worldopenTSDB - Metrics for a distributed world
openTSDB - Metrics for a distributed world
 
CSS3 now
CSS3 nowCSS3 now
CSS3 now
 
Human APIs
Human APIsHuman APIs
Human APIs
 
Techniques for Managing Huge Data LISA10
Techniques for Managing Huge Data LISA10Techniques for Managing Huge Data LISA10
Techniques for Managing Huge Data LISA10
 
Designing for garbage collection
Designing for garbage collectionDesigning for garbage collection
Designing for garbage collection
 
Developing in HTML5: Widgetbox & Sencha Touch
Developing in HTML5: Widgetbox & Sencha TouchDeveloping in HTML5: Widgetbox & Sencha Touch
Developing in HTML5: Widgetbox & Sencha Touch
 
Edge detection of video using matlab code
Edge detection of video using matlab codeEdge detection of video using matlab code
Edge detection of video using matlab code
 
Concurrency: Rubies, Plural
Concurrency: Rubies, PluralConcurrency: Rubies, Plural
Concurrency: Rubies, Plural
 
Concurrency: Rubies, plural
Concurrency: Rubies, pluralConcurrency: Rubies, plural
Concurrency: Rubies, plural
 
Derailed chef update-oct2010
Derailed chef update-oct2010Derailed chef update-oct2010
Derailed chef update-oct2010
 
PHP in a Mobile Ecosystem (Zendcon 2010)
PHP in a Mobile Ecosystem (Zendcon 2010)PHP in a Mobile Ecosystem (Zendcon 2010)
PHP in a Mobile Ecosystem (Zendcon 2010)
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Introduction to Vaadin 7
Introduction to Vaadin 7Introduction to Vaadin 7
Introduction to Vaadin 7
 
Intro to Clojure's core.async
Intro to Clojure's core.asyncIntro to Clojure's core.async
Intro to Clojure's core.async
 
Data driven app deploys with chef frontdev
Data driven app deploys with chef frontdevData driven app deploys with chef frontdev
Data driven app deploys with chef frontdev
 
Advanced Performance Tuning in Ext GWT
Advanced Performance Tuning in Ext GWTAdvanced Performance Tuning in Ext GWT
Advanced Performance Tuning in Ext GWT
 
RubyConf UY 2010
RubyConf UY 2010RubyConf UY 2010
RubyConf UY 2010
 

Plus de bergel

Roassal presentation
Roassal presentationRoassal presentation
Roassal presentation
bergel
 

Plus de bergel (10)

Building Neural Network Through Neuroevolution
Building Neural Network Through NeuroevolutionBuilding Neural Network Through Neuroevolution
Building Neural Network Through Neuroevolution
 
Roassal presentation
Roassal presentationRoassal presentation
Roassal presentation
 
2011 famoosr
2011 famoosr2011 famoosr
2011 famoosr
 
2011 ecoop
2011 ecoop2011 ecoop
2011 ecoop
 
Test beautycleanness
Test beautycleannessTest beautycleanness
Test beautycleanness
 
The Pharo Programming Language
The Pharo Programming LanguageThe Pharo Programming Language
The Pharo Programming Language
 
2008 Sccc Inheritance
2008 Sccc Inheritance2008 Sccc Inheritance
2008 Sccc Inheritance
 
Presentation of Traits
Presentation of TraitsPresentation of Traits
Presentation of Traits
 
2004 Esug Prototalk
2004 Esug Prototalk2004 Esug Prototalk
2004 Esug Prototalk
 
2005 Oopsla Classboxj
2005 Oopsla Classboxj2005 Oopsla Classboxj
2005 Oopsla Classboxj
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Multi dimensional profiling