Understanding and Tuning the Performance of Critical Sections with Program Analysis and Software Visualization Tools
Michael Dilip Shah Advisor: Samuel Z. Guyer Monday July 31, 2017
1
Understanding and Tuning the Performance of Critical Sections with - - PowerPoint PPT Presentation
Understanding and Tuning the Performance of Critical Sections with Program Analysis and Software Visualization Tools Michael Dilip Shah Advisor: Samuel Z. Guyer Monday July 31, 2017 1 Why Care About Performance Servers Mobile
Michael Dilip Shah Advisor: Samuel Z. Guyer Monday July 31, 2017
1
Image Sources: www.facebook.com http://www.techcrok.com/ http://modloader-for-minecraft.en.softonic.com/
2
"The number of transistors incorporated in a chip will approximately double every 24 months."
http://www-cs-faculty.stanford.edu/~eroberts/cs181/projects/2010-11/TechnologicalSingularity/pageviewa478.html?file=forfeasibility.html
3
"The number of transistors incorporated in a chip will approximately double every 24 months."
http://www-cs-faculty.stanford.edu/~eroberts/cs181/projects/2010-11/TechnologicalSingularity/pageviewa478.html?file=forfeasibility.html
4
transistors are packed very tightly together
Compute Y Compute Z
5
6
Sunflow – Java Multithreaded Raytracer
7
Sunflow – Java Multithreaded Raytracer
8
9
Threads Time per frame
10
faster?
Threads Time per frame
program
11
12
13
14
Blocked Blocked Blocked
synchronized void modifyBunny() { // . . . // modify geometry for the bunny // . . . }
15
synchronized void modifyBunny() { // . . . // modify geometry for the bunny // . . . }
16
thread at a given time.
Blocked Blocked
17
public class DrawPicture{ DrawPicture(…) {…} lighting (…) {…} tesselate(…) {…} shadows (…) {…} geometry(…) {…} getPixel (…) {…} getNumLights (…) {…} }
18
public class DrawPicture{ DrawPicture(…) {…} lighting (…) {…} tesselate(…) {…} shadows (…) {…} geometry(…) {…} getPixel (…) {…} getNumLights (…) {…} }
19
synchronized synchronized synchronized synchronized synchronized synchronized Good job— no data races here!
http://www-cs-faculty.stanford.edu/~eroberts/cs181/projects/2010-11/TechnologicalSingularity/pageviewa478.html?file=forfeasibility.html
Your program runs sequentially– did you forget about Amdahl’s law?
20
amongst threads.
21
22
simple patches. These inefficient code sequences can cause significant performance degradation and resource waste, referred to as performance bugs. Meager increases in single threaded performance in the multi-core era and increasing emphasis on energy efficiency call for more effort in tackling performance bugs. “
23
simple patches. These inefficient code sequences can cause significant performance degradation and resource waste, referred to as performance bugs. Meager increases in single threaded performance in the multi-core era and increasing emphasis on energy efficiency call for more effort in tackling performance bugs. “
24
simple patches. These inefficient code sequences can cause significant performance degradation and resource waste, referred to as performance bugs. Meager increases in single threaded performance in the multi-core era and increasing emphasis on energy efficiency call for more effort in tackling performance bugs. “
25
Memory-Access Patterns
number of performance tests analyzed and enables performance bugs to easily escape to production. “
26
Memory-Access Patterns
number of performance tests analyzed and enables performance bugs to easily escape to production. “
27
28
29
30
31
32
33
34
Execute Program with Javaagent Build Javaagent Write Transformation Compile with Java compiler
35
Compile with Java compiler
methods to instrument
36
Write Transformation Compile with Java compiler
bytecode .
37
Write Transformation
Compile with Java compiler
38
Build Javaagent Write Transformation Compile with Java compiler
39
Execute Program with Javaagent Build Javaagent Write Transformation Compile with Java compiler
sections
40
Execute Program with Javaagent Build Javaagent Write Transformation Compile with Java compiler
sections
methods
41
Execute Program with Javaagent Build Javaagent Write Transformation Compile with Java compiler
sections
methods
instrumentation
42
Execute Program with Javaagent Build Javaagent Write Transformation Compile with Java compiler
sections
methods
instrumentation
43
Execute Program with Javaagent Build Javaagent Write Transformation Compile with Java compiler
44
45
Time (Ns) Nth Execution of the same method
46
Time (Ns) Nth Execution of the same method
47
Time (Ns) Nth Execution of the same method
48
Time (Ns) Nth Execution of the same method
49
Time (Ns) Nth Execution of the same method
50
Time (Ns) Nth Execution of the same method
51
Time (Ns) Nth Execution of the same method
52
Time (Ns) Nth Execution of the same method
53
Time (Ns) Nth Execution of the same method
54
Time (Ns) Nth Execution of the same method
55
56
57
58
Skulls – Video Game Sunflow - Raytracer Mediaplayer – Hi-resolution .mp4 video player
59
60
synchronized methods
diverged during most of their executions
time we spend within synchronized method
to fix.
61
renderer to draw to the screen
62
renderer to draw to the screen
state
63
(source code tiny on purpose)
renderer to draw to the screen
state
minute movie
64
(source code tiny on purpose)
renderer to draw to the screen
state
minute movie
65
(source code tiny on purpose)
analyzed.
66
67
68
69
70
The committee for their patience, feedback, guidance, and support!
71
Michael Dilip Shah Advisor: Samuel Z. Guyer Monday July 31, 2017
Committee Members
72