SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
Visualizing Dynamic
Metrics with Profiling
     Blueprints
Alexandre Bergel, Romain Robbes, Walter Binder
        University of Chile       University of
              Chile                Lugano
“software profiling is the investigation
of a program's behavior using
information gathered as the program
executes”
                             - Wikipedia




                                           2
{               {
    {                   {
                            }
        }
        }
            }       {       }




                                3
{               {
    {                   {
                            }
        }
        }
            }       {       }




                                4
1.4
{               {
    {                   {
                            }
        }
        }
            }       {       }




                                      5
1.4
{
                                5.2
                {
    {                   {
                            }
        }
        }
            }       {       }




                                      6
1.4
{
                                5.2
                {
    {
        }
        }
                        {
                            }   5.6
            }       {       }




                                      7
1.4
{
                                5.2
                {
    {
        }
        }
                        {
                            }   5.6
            }       {       }
                                2.3




                                      8
1.4
{
                                5.2
                {
    {
        }
        }
                        {
                            }   5.6
            }       {       }
                                2.3
                                0.5
                                ...



                                      9
1.4
{
                                5.2             }
                {
                                5.6
                                                    }
    {                   {                                   }
                            }                             } {
        }
        }                                               } {

                                2.3
                                                        {
            }       {       }                                   {
                                                                    {


                                0.5
                                ...   Understanding why




                                                                        10
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
                                                                     11
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]
-----------------------------------------------
                                                                                 12
YourKit




          13
YourKit




          14
JProfiler




           15
JProfiler




           16
JProfiler




           17
Retrospective on profiling




Information conveyed hasn’t evolved since gprof
Useful to understand what happened
But is of little help to understand why and how




                                                  18
Roadmap




1.Polymetric views
2.Profiling Blueprint
3.Implementation




                                 19
Polymetric view can map up to 5
               dimensions
                   width property



                       color         height
                     property       property
      X property


   Y
property




                                      [Lanza 2003]   20
KaiProfiler
  viewProfiling: [
    | view |
!   view := MOViewRenderer new.
!   view
      nodes: (1 to: 100)
      forEach: [:each |
        view nodes: (1 to: 100)].
!   view root applyLayout
! ]




                                    21
Structural blueprint




                  legend for methods
                                 # executions




                                     (color)
                    execution
                                   #different
                      time
                                    receiver




                                                22
Structural blueprint




bounds



                           legend for methods
                                          # executions




                                              (color)
                             execution
                                            #different
                               time
                                             receiver




                                                         23
Behavioral blueprint




              legend for methods
                             # executions


                                gray =
                                return      m1     m3
                                 self
                execution                           m1
                  time         yellow =           invokes
                               constant     m2   m2 and m3
                               on return
                                value
                                                             24
Behavioral blueprint




                  legend for methods
                                 # executions


                                    gray =
                                    return      m1     m3
                                     self
                    execution                           m1
                      time         yellow =           invokes
                                                m2   m2 and m3
bounds
                                   constant
                                   on return
                                    value
                                                                 25
Detailed behavioral blueprint

                       computeExtentHavingChildrenFor:




                                            MOGraphElement>>
                                                 origin

    Calling #bounds



                                       bounds




   Called by #bounds
                       shapeBoundsAt:ifPresent:



                                                               26
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


                                                           27
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


                                                           28
Upgrading
        MOGraphElement>>bounds


A

    B
                     C




                                 29
43%
speedup             Upgrading
              MOGraphElement>>bounds


      A

          B
                           C




                                       30
A




      Upgrading
MOGraphElement>>bounds




                             B




                                 31
B                  C
                      A




    cached
absoluteBounds
                                                 instea




                 A'

                                        C'



                                   B'




                              C'


                                             32
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

  a method is void (i.e., return self in Pharo)




                                                  33
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



                                                       34
Implementation techniques

  Visualizations are generated using a scripting
languages
 ... in Mondrian


 Limitation
   hash code collisions (problem in Pharo)

   need to do execute the code to profile twice (sampling and
  instrumentation)




                                                               35
Implemented in Pharo
Smalltalk dialect
Dynamically typed language




                             36
Conclusion




Effective visualizations
Smooth integration in the programming environment
Implemented in Pharo




                                                    37
Conclusion



 A number of bottlenecks were identified
 No general rule for pattern identification
 Visualizations are effective for identifying potential
candidate for optimization




                                                          38
Conclusion



Future work
  close integration in the programming environment

  dedicated visualization for comparison

  additional metrics, e.g., the number of executed bytecodes,
 memory usage




                                                                39
Visualizing Dynamic Metrics with Profiling
               Blueprints

 www.moosetechnology.org/tools/Spy




  A                        Alexandre Bergel, Romain Robbes,
                                     Walter Binder
           B

                   C




                                  abergel@dcc.uchile.cl
                                                              40

Más contenido relacionado

Similar a Visualizing Dynamic Metrics with Profiling Blueprints

การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1
s6527718t
 
กระบวนการเทคโนโลยีสารสนเทศ
กระบวนการเทคโนโลยีสารสนเทศกระบวนการเทคโนโลยีสารสนเทศ
กระบวนการเทคโนโลยีสารสนเทศ
JL'mind Chutimon
 
Section 6 practice b
Section 6 practice bSection 6 practice b
Section 6 practice b
jslloyd23
 
Las ม.2 ปีการศึกษา 2554
Las ม.2 ปีการศึกษา 2554Las ม.2 ปีการศึกษา 2554
Las ม.2 ปีการศึกษา 2554
Aobinta In
 
โครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
โครงการทันตสุขภาพคนพิการ สสจ.เชียงรายโครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
โครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
Nithimar Or
 
Order of operations practice puzzle
Order of operations practice puzzleOrder of operations practice puzzle
Order of operations practice puzzle
jslloyd23
 
หน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญา
หน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญาหน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญา
หน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญา
shikapu
 
Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237
Banking at Ho Chi Minh city
 
Final project
Final projectFinal project
Final project
akram910
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
 
Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)
asghar123456
 

Similar a Visualizing Dynamic Metrics with Profiling Blueprints (20)

Profiling blueprints
Profiling blueprintsProfiling blueprints
Profiling blueprints
 
การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1
 
Powerpoint ประกอบการบรรยาย
Powerpoint ประกอบการบรรยายPowerpoint ประกอบการบรรยาย
Powerpoint ประกอบการบรรยาย
 
Incremental statistics for partitioned tables in 11g by wwf from ebay COC
Incremental statistics for partitioned tables in 11g  by wwf from ebay COCIncremental statistics for partitioned tables in 11g  by wwf from ebay COC
Incremental statistics for partitioned tables in 11g by wwf from ebay COC
 
กระบวนการเทคโนโลยีสารสนเทศ
กระบวนการเทคโนโลยีสารสนเทศกระบวนการเทคโนโลยีสารสนเทศ
กระบวนการเทคโนโลยีสารสนเทศ
 
Military pay raise history & projections 1976 2017
Military pay raise history & projections 1976   2017Military pay raise history & projections 1976   2017
Military pay raise history & projections 1976 2017
 
第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)
第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)
第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)
 
Blind elephant black hat 2010 v2
Blind elephant   black hat 2010 v2Blind elephant   black hat 2010 v2
Blind elephant black hat 2010 v2
 
How to write LaTeX package
How to write LaTeX packageHow to write LaTeX package
How to write LaTeX package
 
Section 6 practice b
Section 6 practice bSection 6 practice b
Section 6 practice b
 
Las ม.2 ปีการศึกษา 2554
Las ม.2 ปีการศึกษา 2554Las ม.2 ปีการศึกษา 2554
Las ม.2 ปีการศึกษา 2554
 
โครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
โครงการทันตสุขภาพคนพิการ สสจ.เชียงรายโครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
โครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
 
Order of operations practice puzzle
Order of operations practice puzzleOrder of operations practice puzzle
Order of operations practice puzzle
 
หน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญา
หน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญาหน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญา
หน่วยการเรียนรู้ที่ 6 ทรัพย์สินทางปัญญา
 
Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald Partitioning
 
Final project
Final projectFinal project
Final project
 
14157565 embedded-programming
14157565 embedded-programming14157565 embedded-programming
14157565 embedded-programming
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
 
Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)
 

Más 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 programming
ESUG
 
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
ESUG
 
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 results
ESUG
 
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
ESUG
 
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
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
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
ESUG
 
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
ESUG
 
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
ESUG
 
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
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
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
ESUG
 

Más 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

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
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
 

Último (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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...
 
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
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
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, ...
 

Visualizing Dynamic Metrics with Profiling Blueprints

  • 1. Visualizing Dynamic Metrics with Profiling Blueprints Alexandre Bergel, Romain Robbes, Walter Binder University of Chile University of Chile Lugano
  • 2. “software profiling is the investigation of a program's behavior using information gathered as the program executes” - Wikipedia 2
  • 3. { { { { } } } } { } 3
  • 4. { { { { } } } } { } 4
  • 5. 1.4 { { { { } } } } { } 5
  • 6. 1.4 { 5.2 { { { } } } } { } 6
  • 7. 1.4 { 5.2 { { } } { } 5.6 } { } 7
  • 8. 1.4 { 5.2 { { } } { } 5.6 } { } 2.3 8
  • 9. 1.4 { 5.2 { { } } { } 5.6 } { } 2.3 0.5 ... 9
  • 10. 1.4 { 5.2 } { 5.6 } { { } } } { } } } { 2.3 { } { } { { 0.5 ... Understanding why 10
  • 11. 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 11
  • 12. 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] ----------------------------------------------- 12
  • 13. YourKit 13
  • 14. YourKit 14
  • 18. Retrospective on profiling Information conveyed hasn’t evolved since gprof Useful to understand what happened But is of little help to understand why and how 18
  • 20. Polymetric view can map up to 5 dimensions width property color height property property X property Y property [Lanza 2003] 20
  • 21. KaiProfiler viewProfiling: [ | view | ! view := MOViewRenderer new. ! view nodes: (1 to: 100) forEach: [:each | view nodes: (1 to: 100)]. ! view root applyLayout ! ] 21
  • 22. Structural blueprint legend for methods # executions (color) execution #different time receiver 22
  • 23. Structural blueprint bounds legend for methods # executions (color) execution #different time receiver 23
  • 24. Behavioral blueprint legend for methods # executions gray = return m1 m3 self execution m1 time yellow = invokes constant m2 m2 and m3 on return value 24
  • 25. Behavioral blueprint legend for methods # executions gray = return m1 m3 self execution m1 time yellow = invokes m2 m2 and m3 bounds constant on return value 25
  • 26. Detailed behavioral blueprint computeExtentHavingChildrenFor: MOGraphElement>> origin Calling #bounds bounds Called by #bounds shapeBoundsAt:ifPresent: 26
  • 27. 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 27
  • 28. 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 28
  • 29. Upgrading MOGraphElement>>bounds A B C 29
  • 30. 43% speedup Upgrading MOGraphElement>>bounds A B C 30
  • 31. A Upgrading MOGraphElement>>bounds B 31
  • 32. B C A cached absoluteBounds instea A' C' B' C' 32
  • 33. 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 a method is void (i.e., return self in Pharo) 33
  • 34. 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 34
  • 35. Implementation techniques Visualizations are generated using a scripting languages ... in Mondrian Limitation hash code collisions (problem in Pharo) need to do execute the code to profile twice (sampling and instrumentation) 35
  • 36. Implemented in Pharo Smalltalk dialect Dynamically typed language 36
  • 37. Conclusion Effective visualizations Smooth integration in the programming environment Implemented in Pharo 37
  • 38. Conclusion A number of bottlenecks were identified No general rule for pattern identification Visualizations are effective for identifying potential candidate for optimization 38
  • 39. Conclusion Future work close integration in the programming environment dedicated visualization for comparison additional metrics, e.g., the number of executed bytecodes, memory usage 39
  • 40. Visualizing Dynamic Metrics with Profiling Blueprints www.moosetechnology.org/tools/Spy A Alexandre Bergel, Romain Robbes, Walter Binder B C abergel@dcc.uchile.cl 40