Object-centric profiling: Advanced Visualizations to Tame Wild - - PowerPoint PPT Presentation

object centric profiling
SMART_READER_LITE
LIVE PREVIEW

Object-centric profiling: Advanced Visualizations to Tame Wild - - PowerPoint PPT Presentation

Object-centric profiling: Advanced Visualizations to Tame Wild Program Execution Vanessa Pea, Juan Pablo Sandoval, Pablo Estefo, Alexandre Bergel Object Profile & University of Chile 2 Execution profiling with Kai Problem: Traditional


slide-1
SLIDE 1

Object-centric profiling:

Advanced Visualizations to Tame Wild Program Execution

Vanessa Peña, Juan Pablo Sandoval, Pablo Estefo, Alexandre Bergel Object Profile & University of Chile

slide-2
SLIDE 2

2

slide-3
SLIDE 3

Execution profiling with Kai

Problem:

Traditional code profilers are driven by the method stack,

discarding the notion of sending messages

Why the problem is important:

How to answer to “Is there a slow function that is called too

  • ften?”

Solution:

An intuitive visual representation of the execution that visually

compare the time spent and the number of executions

3

slide-4
SLIDE 4

54.8% {11501ms} MOCanvas>>drawOn: 54.8% {11501ms} MORoot(MONode)>>displayOn: 30.9% {6485ms} MONode>>displayOn: | 18.1% {3799ms} MOEdge>>displayOn: ... | 8.4% {1763ms} MOEdge>>displayOn: | | 8.0% {1679ms} MOStraightLineShape>>display:on: | | 2.6% {546ms} FormCanvas>>line:to:width:color: ... 23.4% {4911ms} MOEdge>>displayOn: ...

Execution sampling profiler

4

slide-5
SLIDE 5

Structural profiling blueprint

legend for methods (color) #different receiver # executions execution time

5

slide-6
SLIDE 6

Behavioral profiling blueprint

6

legend for methods gray = side effect yellow = no side effect # executions execution time

m2

m1 invokes m2 and m3

m1 m3

DEMO

slide-7
SLIDE 7

Structural profiling blueprint

legend for methods (color) #different receiver # executions execution time

bounds

7

slide-8
SLIDE 8

legend for methods gray = side effect yellow = no side effect # executions execution time

m2

m1 invokes m2 and m3

m1 m3

Behavioral profiling blueprint

bounds

8

slide-9
SLIDE 9

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

9

slide-10
SLIDE 10

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

10

slide-11
SLIDE 11

A B C

Upgrading MOGraphElement>>bounds

11

slide-12
SLIDE 12

A B C

Upgrading MOGraphElement>>bounds

43% speedup

12

slide-13
SLIDE 13

B A

Upgrading MOGraphElement>>bounds 13

slide-14
SLIDE 14

A B C

cached absoluteBounds instead of

A' C' B' C'

14

slide-15
SLIDE 15

A B C D

cached absoluteBounds make display:on: call absoluteBounds instead of absoluteBoundsFor:

A' C' B' C'

15

slide-16
SLIDE 16

A B C D

cached absoluteBounds make display:on: call absoluteBounds instead of absoluteBoundsFor:

A' C' B' C'

16

slide-17
SLIDE 17

Test coverage with Hapao

Problem:

Traditional code coverage tools have a binary view of the world

Why the problem is important:

Which method should you test first in order to increase the

coverage?

Is my code well covered or not?

Solution:

An intuitive visual representation of a qualitative assessment of the

coverage

17

slide-18
SLIDE 18

Test blueprint

c d # calling methods complexity # executions Legend for methods (inner boxes) red = not executed blue = abstract invocation on self C1 C2

18

DEMO

slide-19
SLIDE 19

Successive improvement

Version 2.2 27.27% Version 2.3 54.54% Version 2.4 87.71% Version 2.5 100%

19

slide-20
SLIDE 20

4 patterns

20

slide-21
SLIDE 21

Moose-Test-Core.13 Moose-Core.313 Moose-Test-Core.48 Moose-Core.326

21.42% 56.86% 73.58% 68.25% 0% 36.78% 100% 96.66% 64.55% 100% 100% 100%

21

slide-22
SLIDE 22

Reducing code complexity

Version 1.58.1 Coverage: 40.57% Version 1.58.9 Coverage: 60.60%

22

slide-23
SLIDE 23

Reducing code complexity

Version 2.10 Version 2.17

23

slide-24
SLIDE 24

Visualizing data with Roassal

Roassal is an agile and interactive visualization engine

slide-25
SLIDE 25

Visualizing Incidents at the Fire Department of NY

slide-26
SLIDE 26

Supported Platforms

slide-27
SLIDE 27
slide-28
SLIDE 28

XMLTokenizer>>nextName XMLNestedStreamReader>>atEnd

xecutions source code red: change black: do not change ssages < than before messages > than before and xecutions <= than before ssages > than before and xecutions > than before ssages = than before thod did not exist before

thods

m1 m2 m1 invokes m2

Multidimentional profiling

slide-29
SLIDE 29

Differences between tests

slide-30
SLIDE 30

Conclusion

Little innovation in the tools we commonly use

Profilers, debuggers, testing tools have not significantly evolved

Fantastic opportunities for improvement Kai, Hapao and Roassal are just a beginning Feel free to provide feedback on our tool

30

slide-31
SLIDE 31

Spy @ Cincom Store Spy @ SqueakSource Roassal @ ... ObjectProfile.com

Moose-Test-Core.13 Moose-Core.313 Moose-Test-Core.48 Moose-Core.326

21.42% 56.86% 73.58% 68.25% 0% 36.78% 100% 96.66% 64.55% 100% 100% 100%

Thanks to ESUG Chris T Cincom All of you guys!