SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie Visualizing Dynamic Metrics with Profiling Blueprints

Profiling blueprints
Profiling blueprintsProfiling blueprints
Profiling blueprintsbergel
 
การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1s6527718t
 
Simple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaSimple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaUniversidad Carlos III de Madrid
 
Powerpoint ประกอบการบรรยาย
Powerpoint ประกอบการบรรยายPowerpoint ประกอบการบรรยาย
Powerpoint ประกอบการบรรยายevaluation47
 
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 COCLouis liu
 
กระบวนการเทคโนโลยีสารสนเทศ
กระบวนการเทคโนโลยีสารสนเทศกระบวนการเทคโนโลยีสารสนเทศ
กระบวนการเทคโนโลยีสารสนเทศJL'mind Chutimon
 
第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)
第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)
第2回 基本演算,データ型の基礎,ベクトルの操作方法(解答付き)Wataru Shito
 
Blind elephant black hat 2010 v2
Blind elephant   black hat 2010 v2Blind elephant   black hat 2010 v2
Blind elephant black hat 2010 v2Jaime Restrepo
 
How to write LaTeX package
How to write LaTeX packageHow to write LaTeX package
How to write LaTeX packageRuini Xue
 
Section 6 practice b
Section 6 practice bSection 6 practice b
Section 6 practice bjslloyd23
 
Las ม.2 ปีการศึกษา 2554
Las ม.2 ปีการศึกษา 2554Las ม.2 ปีการศึกษา 2554
Las ม.2 ปีการศึกษา 2554Aobinta In
 
โครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
โครงการทันตสุขภาพคนพิการ สสจ.เชียงรายโครงการทันตสุขภาพคนพิการ สสจ.เชียงราย
โครงการทันตสุขภาพคนพิการ สสจ.เชียงรายNithimar Or
 
Order of operations practice puzzle
Order of operations practice puzzleOrder of operations practice puzzle
Order of operations practice puzzlejslloyd23
 
หน่วยการเรียนรู้ที่ 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 sg247237Banking at Ho Chi Minh city
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald PartitioningInSync Conference
 
Final project
Final projectFinal project
Final projectakram910
 
14157565 embedded-programming
14157565 embedded-programming14157565 embedded-programming
14157565 embedded-programmingPRADEEP
 

Ähnlich wie Visualizing Dynamic Metrics with Profiling Blueprints (20)

Profiling blueprints
Profiling blueprintsProfiling blueprints
Profiling blueprints
 
การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1การผันวรรณยุกต์ ป.1
การผันวรรณยุกต์ ป.1
 
Simple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time JavaSimple asynchronous remote invocations for distributed real-time Java
Simple asynchronous remote invocations for distributed real-time Java
 
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
 
Quick Wins
Quick WinsQuick Wins
Quick Wins
 

Mehr von ESUG

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

Mehr von ESUG (20)

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

Kürzlich hochgeladen

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

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