SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Uncovering	
  Performance	
  Problems	
  in	
  Java	
  
Applica5ons	
  with	
  Reference	
  Propaga5on	
  Profiling	
  

       Dacong	
  Yan1,	
  Guoqing	
  Xu2,	
  Atanas	
  Rountev1	
  
                                	
  
                                  1	
  Ohio	
  State	
  University	
  
                         2	
  University	
  of	
  California,	
  Irvine	
  
                                                                  	
  

           PRESTO:	
  Program	
  Analyses	
  and	
  So5ware	
  Tools	
  Research	
  Group,	
  Ohio	
  State	
  University	
  
Overview	
  
        •  Performance	
  inefficiencies	
  
           –  O5en	
  exist	
  in	
  Java	
  applicaKons	
  
           –  Excessive	
  memory	
  usage	
  
           –  Long	
  running	
  Kmes,	
  even	
  for	
  simple	
  tasks	
  
        •  Challenges	
  
           –  Limited	
  compiler	
  opKmizaKons	
  
           –  Complicated	
  behavior	
  
           –  Large	
  libraries	
  and	
  frameworks	
  
        •  SoluKon:	
  manual	
  tuning	
  assisted	
  with	
  performance	
  
           analysis	
  tools	
  

2	
  
An	
  Example	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
3	
  
An	
  Example	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
4	
  
An	
  Example	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
5	
  
An	
  Example	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
6	
  
An	
  Example	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
7	
  
An	
  Example	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
8	
  
ImplementaKon	
  
        •  Reference	
  propagaKon	
  profiling	
  
           –  Implemented	
  in	
  Jikes	
  RVM	
  3.1.1	
  
           –  Modify	
  the	
  runKme	
  compiler	
  for	
  code	
  instrumentaKon	
  
           –  Create	
  shadow	
  loca5ons	
  to	
  track	
  data	
  dependence	
  
           –  Instrument	
  method	
  calls	
  to	
  track	
  interprocedural	
  
              propaga5on	
  

        •  Overheads	
  
           –  Space:	
  2-­‐3×	
  
           –  Time:	
  30-­‐50×	
  	
  


9	
  
Reference	
  PropagaKon	
  Profiling	
  
  •  Intraprocedural	
  propagaKon	
  
           –  Shadows	
  for	
  every	
  memory	
  locaKon	
  (stack	
  and	
  heap)	
  to	
  
              record	
  last	
  assignment	
  that	
  writes	
  to	
  it	
  
           –  Update	
  shadows	
  and	
  the	
  graph	
  accordingly	
  
             Code                       Shadow                            Graph

         6 a = new A;              aʹ = RefAssign(6,6)
         7 b = a;                  bʹ = RefAssign(6,7)
         8 c = new C;              cʹ = RefAssign(8, 8)
         9 b.fld = c;              b.fldʹ = RefAssign(8, 9)




10	
  
Reference	
  PropagaKon	
  Profiling	
  
  •  Intraprocedural	
  propagaKon	
  
           –  Shadows	
  for	
  every	
  memory	
  locaKon	
  (stack	
  and	
  heap)	
  to	
  
              record	
  last	
  assignment	
  that	
  writes	
  to	
  it	
  
           –  Update	
  shadows	
  and	
  the	
  graph	
  accordingly	
  
             Code                       Shadow                            Graph

         6 a = new A;              aʹ = RefAssign(6,6)
         7 b = a;                  bʹ = RefAssign(6,7)
         8 c = new C;              cʹ = RefAssign(8, 8)
         9 b.fld = c;              b.fldʹ = RefAssign(8, 9)




11	
  
Reference	
  PropagaKon	
  Profiling	
  
  •  Intraprocedural	
  propagaKon	
  
           –  Shadows	
  for	
  every	
  memory	
  locaKon	
  (stack	
  and	
  heap)	
  to	
  
              record	
  last	
  assignment	
  that	
  writes	
  to	
  it	
  
           –  Update	
  shadows	
  and	
  the	
  graph	
  accordingly	
  
             Code                       Shadow                            Graph

         6 a = new A;              aʹ = RefAssign(6,6)
         7 b = a;                  bʹ = RefAssign(6,7)
         8 c = new C;              cʹ = RefAssign(8, 8)
         9 b.fld = c;              b.fldʹ = RefAssign(8, 9)




12	
  
Reference	
  PropagaKon	
  Profiling	
  
  •  Intraprocedural	
  propagaKon	
  
           –  Shadows	
  for	
  every	
  memory	
  locaKon	
  (stack	
  and	
  heap)	
  to	
  
              record	
  last	
  assignment	
  that	
  writes	
  to	
  it	
  
           –  Update	
  shadows	
  and	
  the	
  graph	
  accordingly	
  
             Code                       Shadow                            Graph

         6 a = new A;              aʹ = RefAssign(6,6)
         7 b = a;                  bʹ = RefAssign(6,7)
         8 c = new C;              cʹ = RefAssign(8, 8)
         9 b.fld = c;              b.fldʹ = RefAssign(8, 9)




13	
  
Reference	
  PropagaKon	
  Profiling	
  
  •  Intraprocedural	
  propagaKon	
  
           –  Shadows	
  for	
  every	
  memory	
  locaKon	
  (stack	
  and	
  heap)	
  to	
  
              record	
  last	
  assignment	
  that	
  writes	
  to	
  it	
  
           –  Update	
  shadows	
  and	
  the	
  graph	
  accordingly	
  
             Code                       Shadow                            Graph

         6 a = new A;              aʹ = RefAssign(6,6)
         7 b = a;                  bʹ = RefAssign(6,7)
         8 c = new C;              cʹ = RefAssign(8, 8)
         9 b.fld = c;              b.fldʹ = RefAssign(8, 9)




14	
  
Reference	
  PropagaKon	
  Profiling	
  
  •  Intraprocedural	
  propagaKon	
  
           –  Shadows	
  for	
  every	
  memory	
  locaKon	
  (stack	
  and	
  heap)	
  to	
  
              record	
  last	
  assignment	
  that	
  writes	
  to	
  it	
  
           –  Update	
  shadows	
  and	
  the	
  graph	
  accordingly	
  
             Code                       Shadow                            Graph

         6 a = new A;              aʹ = RefAssign(6,6)
         7 b = a;                  bʹ = RefAssign(6,7)
         8 c = new C;              cʹ = RefAssign(8, 8)
         9 b.fld = c;              b.fldʹ = RefAssign(8, 9)


  •  Interprocedural	
  propagaKon	
  
           –  Per-­‐thread	
  scratch	
  space	
  save	
  and	
  restore	
  shadows	
  for	
  
15	
  
              parameters	
  and	
  return	
  variables	
  
Client	
  Analyses
                          	
  




16	
  
Client	
  Analyses
                                                   	
  
    •  Not-­‐assigned-­‐to-­‐heap	
  (NATH)	
  analysis	
  
         –  Locate	
  producer	
  nodes	
  that	
  do	
  not	
  reach	
  heap	
  
            propagaKon	
  nodes	
  (heap	
  reads	
  and	
  writes)	
  
         –  Variant:	
  mostly-­‐NATH	
  analysis	
  




17	
  
Client	
  Analyses
                                                   	
  
    •  Not-­‐assigned-­‐to-­‐heap	
  (NATH)	
  analysis	
  
         –  Locate	
  producer	
  nodes	
  that	
  do	
  not	
  reach	
  heap	
  
            propagaKon	
  nodes	
  (heap	
  reads	
  and	
  writes)	
  
         –  Variant:	
  mostly-­‐NATH	
  analysis	
  
    •  Cost-­‐benefit	
  imbalance	
  analysis	
  
         –  Detect	
  imbalance	
  between	
  the	
  cost	
  of	
  interesKng	
  
            operaKons,	
  and	
  the	
  benefits	
  they	
  produce	
  
         –  For	
  example,	
  analysis	
  of	
  write	
  read	
  imbalance	
  




18	
  
Client	
  Analyses
                                                   	
  
    •  Not-­‐assigned-­‐to-­‐heap	
  (NATH)	
  analysis	
  
         –  Locate	
  producer	
  nodes	
  that	
  do	
  not	
  reach	
  heap	
  
            propagaKon	
  nodes	
  (heap	
  reads	
  and	
  writes)	
  
         –  Variant:	
  mostly-­‐NATH	
  analysis	
  
    •  Cost-­‐benefit	
  imbalance	
  analysis	
  
         –  Detect	
  imbalance	
  between	
  the	
  cost	
  of	
  interesKng	
  
            operaKons,	
  and	
  the	
  benefits	
  they	
  produce	
  
         –  For	
  example,	
  analysis	
  of	
  write	
  read	
  imbalance	
  
    •  Analysis	
  of	
  never-­‐used	
  allocaKons	
  
         –  IdenKfy	
  producer	
  nodes	
  that	
  do	
  not	
  reach	
  the	
  
            consumer	
  node	
  
         –  Variant:	
  analysis	
  of	
  rarely-­‐used	
  allocaKons	
  
19	
  
A	
  Real	
  Tuning	
  Session	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
20	
  
A	
  Real	
  Tuning	
  Session	
  
 1 class Vec {
 2 double x, y;
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
21	
  
A	
  Real	
  Tuning	
  Session	
  
 1 class Vec {
 2 double x, y;
                                             1             2
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);  1
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);  2
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
22	
  
A	
  Real	
  Tuning	
  Session	
  
 1 class Vec {
 2 double x, y;
                                             1             2
 3 sub(v) {
 4    res=new Vec(x-v.x, y-v.y);
 5    return res;
 6 }
 7 }
 8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);  1
10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);  2
12    // use of fields of t
13 }
          ……
80 t=q[*];
81 // use of fields of t
23	
  
A	
  Real	
  Tuning	
  Session	
  
 1 class Vec {                             1 class Vec {
 2 double x, y;                            2 double x, y;
 3 sub(v) {                                3 sub_rev(v, res) {
 4    res=new Vec(x-v.x, y-v.y);           4    res.x = x-v.x;
 5    return res;                          5    res.y = y-v.y;
 6 }                                       6 }
 7 }                             tuning    7 } = new Vec; // reusable
                                             nt
 8 for (i = 0; i < N; i++) {               8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);             9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;                           10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);           11     in[i+1].sub_rev(a[i-2], nt);
12    // use of fields of t               12    // use of fields of nt
13 }                                      13 }
          ……                                       ……
80 t=q[*];                                80 t=q[*];
81 // use of fields of t                  81 // use of fields of t
24	
  
A	
  Real	
  Tuning	
  Session	
  
 1 class Vec {                            1 class Vec {
 2 double x, y;                           2 double x, y;
 3 sub(v) {                               3 sub_rev(v, res) {
 4    res=new Vec(x-v.x, y-v.y);          4    res.x = x-v.x;
 5    return res;                         5    res.y = y-v.y;
 6 }                                      6 }
 7 }                             tuning   7 } = new Vec; // reusable
                                            nt
 8 for (i = 0; i < N; i++) {              8 for (i = 0; i < N; i++) {
 9    t = in[i+2].sub(a[i-1]);            9    t = in[i+2].sub(a[i-1]);
10    q[i] = t;                          10    q[i] = t;
11     t = in[i+1].sub(a[i-2]);          11     in[i+1].sub_rev(a[i-2], nt);
12    // use of fields of t              12    // use of fields of nt
13 }                                     13 }
          ……                                      ……
80 t=q[*];          Reductions: 13% in running time and
                                         80 t=q[*];
81 // use of fields of t 73% in #allocated objectsof fields of t
                                         81 // use
25	
  
Examples	
  of	
  Inefficiency	
  Pa`erns
                                                      	
  
    •  Temporary	
  objects	
  for	
  method	
  returns	
  
        –  ReducKons	
  for	
  euler:	
  13%	
  in	
  running	
  Kme	
  and	
  73%	
  in	
  
           #allocated	
  objects	
  
    •  Redundant	
  data	
  representaKon	
  
        – mst:	
  63%	
  and	
  40%	
  
    •  Unnecessary	
  eager	
  object	
  creaKon	
  
        – chart:	
  8%	
  and	
  8%
        – jflex:	
  3%	
  and	
  27%	
  
    •  Expensive	
  specializaKon	
  for	
  sanity	
  checks	
  
        – bloat:	
  10%	
  and	
  11%	
  
26	
  
Conclusions
    •  Reference	
  propagaKon	
  profiling	
  in	
  Jikes	
  RVM	
  
    •  Understanding	
  reference	
  propagaKon	
  is	
  a	
  good	
  
       starKng	
  point	
  for	
  performance	
  tuning	
  
    •  Client	
  analyses	
  can	
  uncover	
  performance	
  
       inefficiencies,	
  and	
  lead	
  to	
  effecKve	
  tuning	
  soluKons	
  




27	
  
Thank	
  	
  you	
  
    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  




28	
  

Weitere ähnliche Inhalte

Was ist angesagt?

AutoDesk
AutoDeskAutoDesk
AutoDeskSE3D
 
GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004Rohit Garg
 
Class 17: Golden Sneezewort
Class 17: Golden SneezewortClass 17: Golden Sneezewort
Class 17: Golden SneezewortDavid Evans
 
R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R Vivian S. Zhang
 
Story of static code analyzer development
Story of static code analyzer developmentStory of static code analyzer development
Story of static code analyzer developmentAndrey Karpov
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Platonov Sergey
 
LR(0) parser in Compiler Consturction
LR(0) parser in Compiler ConsturctionLR(0) parser in Compiler Consturction
LR(0) parser in Compiler ConsturctionMuhammad Haroon
 
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOMEEuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOMEHONGJOO LEE
 
Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++Sumant Tambe
 
MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085Sumadeep Juvvalapalem
 
Gate Computer Science Solved Paper 2007
Gate Computer Science Solved Paper 2007 Gate Computer Science Solved Paper 2007
Gate Computer Science Solved Paper 2007 Rohit Garg
 
Declarative Datalog Debugging for Mere Mortals
Declarative Datalog Debugging for Mere MortalsDeclarative Datalog Debugging for Mere Mortals
Declarative Datalog Debugging for Mere MortalsBertram Ludäscher
 
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrainsit-people
 

Was ist angesagt? (20)

SLE2015: Distributed ATL
SLE2015: Distributed ATLSLE2015: Distributed ATL
SLE2015: Distributed ATL
 
AutoDesk
AutoDeskAutoDesk
AutoDesk
 
GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004GATE Computer Science Solved Paper 2004
GATE Computer Science Solved Paper 2004
 
Class 17: Golden Sneezewort
Class 17: Golden SneezewortClass 17: Golden Sneezewort
Class 17: Golden Sneezewort
 
R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R
 
Story of static code analyzer development
Story of static code analyzer developmentStory of static code analyzer development
Story of static code analyzer development
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”
 
Stack
StackStack
Stack
 
LR(0) parser in Compiler Consturction
LR(0) parser in Compiler ConsturctionLR(0) parser in Compiler Consturction
LR(0) parser in Compiler Consturction
 
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOMEEuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
 
Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++
 
pattern mining
pattern miningpattern mining
pattern mining
 
MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085
 
Gate Computer Science Solved Paper 2007
Gate Computer Science Solved Paper 2007 Gate Computer Science Solved Paper 2007
Gate Computer Science Solved Paper 2007
 
Declarative Datalog Debugging for Mere Mortals
Declarative Datalog Debugging for Mere MortalsDeclarative Datalog Debugging for Mere Mortals
Declarative Datalog Debugging for Mere Mortals
 
2nd Semester M Tech: CMOS VLSI Design (June-2015) Question Papers
2nd Semester M Tech: CMOS VLSI Design (June-2015) Question Papers2nd Semester M Tech: CMOS VLSI Design (June-2015) Question Papers
2nd Semester M Tech: CMOS VLSI Design (June-2015) Question Papers
 
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
Introduction to 8085 by adi ppt
Introduction to 8085 by adi pptIntroduction to 8085 by adi ppt
Introduction to 8085 by adi ppt
 
Europy17_dibernardo
Europy17_dibernardoEuropy17_dibernardo
Europy17_dibernardo
 

Andere mochten auch

Static Reference Analysis for GUI Objects in Android Software
Static Reference Analysis for GUI Objects in Android SoftwareStatic Reference Analysis for GUI Objects in Android Software
Static Reference Analysis for GUI Objects in Android SoftwareDacong (Tony) Yan
 
SherLog: Error Diagnosis by Connecting Clues from Run-time Logs
SherLog: Error Diagnosis by Connecting Clues from Run-time LogsSherLog: Error Diagnosis by Connecting Clues from Run-time Logs
SherLog: Error Diagnosis by Connecting Clues from Run-time LogsDacong (Tony) Yan
 
Efficient Diversity-Aware Search
Efficient Diversity-Aware SearchEfficient Diversity-Aware Search
Efficient Diversity-Aware SearchDacong (Tony) Yan
 
Systematic Testing for Resource Leaks in Android Applications
Systematic Testing for Resource Leaks in Android ApplicationsSystematic Testing for Resource Leaks in Android Applications
Systematic Testing for Resource Leaks in Android ApplicationsDacong (Tony) Yan
 
LeakChecker: Practical Static Memory Leak Detection for Managed Languages
LeakChecker: Practical Static Memory Leak Detection for Managed LanguagesLeakChecker: Practical Static Memory Leak Detection for Managed Languages
LeakChecker: Practical Static Memory Leak Detection for Managed LanguagesDacong (Tony) Yan
 
Members satisfaction research. sensing our current customers
Members satisfaction research. sensing our current customersMembers satisfaction research. sensing our current customers
Members satisfaction research. sensing our current customersIrynka
 

Andere mochten auch (7)

Static Reference Analysis for GUI Objects in Android Software
Static Reference Analysis for GUI Objects in Android SoftwareStatic Reference Analysis for GUI Objects in Android Software
Static Reference Analysis for GUI Objects in Android Software
 
AVIO class present
AVIO class presentAVIO class present
AVIO class present
 
SherLog: Error Diagnosis by Connecting Clues from Run-time Logs
SherLog: Error Diagnosis by Connecting Clues from Run-time LogsSherLog: Error Diagnosis by Connecting Clues from Run-time Logs
SherLog: Error Diagnosis by Connecting Clues from Run-time Logs
 
Efficient Diversity-Aware Search
Efficient Diversity-Aware SearchEfficient Diversity-Aware Search
Efficient Diversity-Aware Search
 
Systematic Testing for Resource Leaks in Android Applications
Systematic Testing for Resource Leaks in Android ApplicationsSystematic Testing for Resource Leaks in Android Applications
Systematic Testing for Resource Leaks in Android Applications
 
LeakChecker: Practical Static Memory Leak Detection for Managed Languages
LeakChecker: Practical Static Memory Leak Detection for Managed LanguagesLeakChecker: Practical Static Memory Leak Detection for Managed Languages
LeakChecker: Practical Static Memory Leak Detection for Managed Languages
 
Members satisfaction research. sensing our current customers
Members satisfaction research. sensing our current customersMembers satisfaction research. sensing our current customers
Members satisfaction research. sensing our current customers
 

Ähnlich wie Uncovering Performance Problems in Java Applications with Reference Propagation Profiling

Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Agora Group
 
Object Oriented Programming in Matlab
Object Oriented Programming in Matlab Object Oriented Programming in Matlab
Object Oriented Programming in Matlab AlbanLevy
 
Streams Don't Fail Me Now - Robustness Features in Kafka Streams
Streams Don't Fail Me Now - Robustness Features in Kafka StreamsStreams Don't Fail Me Now - Robustness Features in Kafka Streams
Streams Don't Fail Me Now - Robustness Features in Kafka StreamsHostedbyConfluent
 
Computational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in RComputational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in Rherbps10
 
Extending lifespan with Hadoop and R
Extending lifespan with Hadoop and RExtending lifespan with Hadoop and R
Extending lifespan with Hadoop and RRadek Maciaszek
 
educational course/tutorialoutlet.com
educational course/tutorialoutlet.comeducational course/tutorialoutlet.com
educational course/tutorialoutlet.comjorge0043
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptMuhammad Sikandar Mustafa
 
Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...
Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...
Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...Spark Summit
 
Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)David de Boer
 
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...MLconf
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSubash John
 

Ähnlich wie Uncovering Performance Problems in Java Applications with Reference Propagation Profiling (20)

Slides
SlidesSlides
Slides
 
Lp seminar
Lp seminarLp seminar
Lp seminar
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
 
Object Oriented Programming in Matlab
Object Oriented Programming in Matlab Object Oriented Programming in Matlab
Object Oriented Programming in Matlab
 
Streams Don't Fail Me Now - Robustness Features in Kafka Streams
Streams Don't Fail Me Now - Robustness Features in Kafka StreamsStreams Don't Fail Me Now - Robustness Features in Kafka Streams
Streams Don't Fail Me Now - Robustness Features in Kafka Streams
 
Computational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in RComputational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in R
 
Extending lifespan with Hadoop and R
Extending lifespan with Hadoop and RExtending lifespan with Hadoop and R
Extending lifespan with Hadoop and R
 
3rd Semester Computer Science and Engineering (ACU-2022) Question papers
3rd Semester Computer Science and Engineering  (ACU-2022) Question papers3rd Semester Computer Science and Engineering  (ACU-2022) Question papers
3rd Semester Computer Science and Engineering (ACU-2022) Question papers
 
Scala+data
Scala+dataScala+data
Scala+data
 
educational course/tutorialoutlet.com
educational course/tutorialoutlet.comeducational course/tutorialoutlet.com
educational course/tutorialoutlet.com
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter ppt
 
Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...
Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...
Time-evolving Graph Processing on Commodity Clusters: Spark Summit East talk ...
 
Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)Being functional in PHP (PHPDay Italy 2016)
Being functional in PHP (PHPDay Italy 2016)
 
Xephon K A Time series database with multiple backends
Xephon K A Time series database with multiple backendsXephon K A Time series database with multiple backends
Xephon K A Time series database with multiple backends
 
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
 
Lecture12
Lecture12Lecture12
Lecture12
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancements
 
Spark training-in-bangalore
Spark training-in-bangaloreSpark training-in-bangalore
Spark training-in-bangalore
 
So you think you can stream.pptx
So you think you can stream.pptxSo you think you can stream.pptx
So you think you can stream.pptx
 
Mit cilk
Mit cilkMit cilk
Mit cilk
 

Kürzlich hochgeladen

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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, Adobeapidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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...DianaGray10
 
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 WoodJuan lago vázquez
 
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 challengesrafiqahmad00786416
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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 educationjfdjdjcjdnsjd
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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 connectorsNanddeep Nachan
 
"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 ...Zilliz
 
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 SavingEdi Saputra
 
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 DiscoveryTrustArc
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
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 Takeoffsammart93
 
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 FMESafe Software
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Kürzlich hochgeladen (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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...
 
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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
"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 ...
 
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
 
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
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
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
 
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
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Uncovering Performance Problems in Java Applications with Reference Propagation Profiling

  • 1. Uncovering  Performance  Problems  in  Java   Applica5ons  with  Reference  Propaga5on  Profiling   Dacong  Yan1,  Guoqing  Xu2,  Atanas  Rountev1     1  Ohio  State  University   2  University  of  California,  Irvine     PRESTO:  Program  Analyses  and  So5ware  Tools  Research  Group,  Ohio  State  University  
  • 2. Overview   •  Performance  inefficiencies   –  O5en  exist  in  Java  applicaKons   –  Excessive  memory  usage   –  Long  running  Kmes,  even  for  simple  tasks   •  Challenges   –  Limited  compiler  opKmizaKons   –  Complicated  behavior   –  Large  libraries  and  frameworks   •  SoluKon:  manual  tuning  assisted  with  performance   analysis  tools   2  
  • 3. An  Example   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 3  
  • 4. An  Example   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 4  
  • 5. An  Example   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 5  
  • 6. An  Example   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 6  
  • 7. An  Example   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 7  
  • 8. An  Example   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 8  
  • 9. ImplementaKon   •  Reference  propagaKon  profiling   –  Implemented  in  Jikes  RVM  3.1.1   –  Modify  the  runKme  compiler  for  code  instrumentaKon   –  Create  shadow  loca5ons  to  track  data  dependence   –  Instrument  method  calls  to  track  interprocedural   propaga5on   •  Overheads   –  Space:  2-­‐3×   –  Time:  30-­‐50×     9  
  • 10. Reference  PropagaKon  Profiling   •  Intraprocedural  propagaKon   –  Shadows  for  every  memory  locaKon  (stack  and  heap)  to   record  last  assignment  that  writes  to  it   –  Update  shadows  and  the  graph  accordingly   Code Shadow Graph 6 a = new A; aʹ = RefAssign(6,6) 7 b = a; bʹ = RefAssign(6,7) 8 c = new C; cʹ = RefAssign(8, 8) 9 b.fld = c; b.fldʹ = RefAssign(8, 9) 10  
  • 11. Reference  PropagaKon  Profiling   •  Intraprocedural  propagaKon   –  Shadows  for  every  memory  locaKon  (stack  and  heap)  to   record  last  assignment  that  writes  to  it   –  Update  shadows  and  the  graph  accordingly   Code Shadow Graph 6 a = new A; aʹ = RefAssign(6,6) 7 b = a; bʹ = RefAssign(6,7) 8 c = new C; cʹ = RefAssign(8, 8) 9 b.fld = c; b.fldʹ = RefAssign(8, 9) 11  
  • 12. Reference  PropagaKon  Profiling   •  Intraprocedural  propagaKon   –  Shadows  for  every  memory  locaKon  (stack  and  heap)  to   record  last  assignment  that  writes  to  it   –  Update  shadows  and  the  graph  accordingly   Code Shadow Graph 6 a = new A; aʹ = RefAssign(6,6) 7 b = a; bʹ = RefAssign(6,7) 8 c = new C; cʹ = RefAssign(8, 8) 9 b.fld = c; b.fldʹ = RefAssign(8, 9) 12  
  • 13. Reference  PropagaKon  Profiling   •  Intraprocedural  propagaKon   –  Shadows  for  every  memory  locaKon  (stack  and  heap)  to   record  last  assignment  that  writes  to  it   –  Update  shadows  and  the  graph  accordingly   Code Shadow Graph 6 a = new A; aʹ = RefAssign(6,6) 7 b = a; bʹ = RefAssign(6,7) 8 c = new C; cʹ = RefAssign(8, 8) 9 b.fld = c; b.fldʹ = RefAssign(8, 9) 13  
  • 14. Reference  PropagaKon  Profiling   •  Intraprocedural  propagaKon   –  Shadows  for  every  memory  locaKon  (stack  and  heap)  to   record  last  assignment  that  writes  to  it   –  Update  shadows  and  the  graph  accordingly   Code Shadow Graph 6 a = new A; aʹ = RefAssign(6,6) 7 b = a; bʹ = RefAssign(6,7) 8 c = new C; cʹ = RefAssign(8, 8) 9 b.fld = c; b.fldʹ = RefAssign(8, 9) 14  
  • 15. Reference  PropagaKon  Profiling   •  Intraprocedural  propagaKon   –  Shadows  for  every  memory  locaKon  (stack  and  heap)  to   record  last  assignment  that  writes  to  it   –  Update  shadows  and  the  graph  accordingly   Code Shadow Graph 6 a = new A; aʹ = RefAssign(6,6) 7 b = a; bʹ = RefAssign(6,7) 8 c = new C; cʹ = RefAssign(8, 8) 9 b.fld = c; b.fldʹ = RefAssign(8, 9) •  Interprocedural  propagaKon   –  Per-­‐thread  scratch  space  save  and  restore  shadows  for   15   parameters  and  return  variables  
  • 16. Client  Analyses   16  
  • 17. Client  Analyses   •  Not-­‐assigned-­‐to-­‐heap  (NATH)  analysis   –  Locate  producer  nodes  that  do  not  reach  heap   propagaKon  nodes  (heap  reads  and  writes)   –  Variant:  mostly-­‐NATH  analysis   17  
  • 18. Client  Analyses   •  Not-­‐assigned-­‐to-­‐heap  (NATH)  analysis   –  Locate  producer  nodes  that  do  not  reach  heap   propagaKon  nodes  (heap  reads  and  writes)   –  Variant:  mostly-­‐NATH  analysis   •  Cost-­‐benefit  imbalance  analysis   –  Detect  imbalance  between  the  cost  of  interesKng   operaKons,  and  the  benefits  they  produce   –  For  example,  analysis  of  write  read  imbalance   18  
  • 19. Client  Analyses   •  Not-­‐assigned-­‐to-­‐heap  (NATH)  analysis   –  Locate  producer  nodes  that  do  not  reach  heap   propagaKon  nodes  (heap  reads  and  writes)   –  Variant:  mostly-­‐NATH  analysis   •  Cost-­‐benefit  imbalance  analysis   –  Detect  imbalance  between  the  cost  of  interesKng   operaKons,  and  the  benefits  they  produce   –  For  example,  analysis  of  write  read  imbalance   •  Analysis  of  never-­‐used  allocaKons   –  IdenKfy  producer  nodes  that  do  not  reach  the   consumer  node   –  Variant:  analysis  of  rarely-­‐used  allocaKons   19  
  • 20. A  Real  Tuning  Session   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 20  
  • 21. A  Real  Tuning  Session   1 class Vec { 2 double x, y; 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 21  
  • 22. A  Real  Tuning  Session   1 class Vec { 2 double x, y; 1 2 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 1 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 2 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 22  
  • 23. A  Real  Tuning  Session   1 class Vec { 2 double x, y; 1 2 3 sub(v) { 4 res=new Vec(x-v.x, y-v.y); 5 return res; 6 } 7 } 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 1 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 2 12 // use of fields of t 13 } …… 80 t=q[*]; 81 // use of fields of t 23  
  • 24. A  Real  Tuning  Session   1 class Vec { 1 class Vec { 2 double x, y; 2 double x, y; 3 sub(v) { 3 sub_rev(v, res) { 4 res=new Vec(x-v.x, y-v.y); 4 res.x = x-v.x; 5 return res; 5 res.y = y-v.y; 6 } 6 } 7 } tuning 7 } = new Vec; // reusable nt 8 for (i = 0; i < N; i++) { 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 11 in[i+1].sub_rev(a[i-2], nt); 12 // use of fields of t 12 // use of fields of nt 13 } 13 } …… …… 80 t=q[*]; 80 t=q[*]; 81 // use of fields of t 81 // use of fields of t 24  
  • 25. A  Real  Tuning  Session   1 class Vec { 1 class Vec { 2 double x, y; 2 double x, y; 3 sub(v) { 3 sub_rev(v, res) { 4 res=new Vec(x-v.x, y-v.y); 4 res.x = x-v.x; 5 return res; 5 res.y = y-v.y; 6 } 6 } 7 } tuning 7 } = new Vec; // reusable nt 8 for (i = 0; i < N; i++) { 8 for (i = 0; i < N; i++) { 9 t = in[i+2].sub(a[i-1]); 9 t = in[i+2].sub(a[i-1]); 10 q[i] = t; 10 q[i] = t; 11 t = in[i+1].sub(a[i-2]); 11 in[i+1].sub_rev(a[i-2], nt); 12 // use of fields of t 12 // use of fields of nt 13 } 13 } …… …… 80 t=q[*]; Reductions: 13% in running time and 80 t=q[*]; 81 // use of fields of t 73% in #allocated objectsof fields of t 81 // use 25  
  • 26. Examples  of  Inefficiency  Pa`erns   •  Temporary  objects  for  method  returns   –  ReducKons  for  euler:  13%  in  running  Kme  and  73%  in   #allocated  objects   •  Redundant  data  representaKon   – mst:  63%  and  40%   •  Unnecessary  eager  object  creaKon   – chart:  8%  and  8% – jflex:  3%  and  27%   •  Expensive  specializaKon  for  sanity  checks   – bloat:  10%  and  11%   26  
  • 27. Conclusions •  Reference  propagaKon  profiling  in  Jikes  RVM   •  Understanding  reference  propagaKon  is  a  good   starKng  point  for  performance  tuning   •  Client  analyses  can  uncover  performance   inefficiencies,  and  lead  to  effecKve  tuning  soluKons   27  
  • 28. Thank    you                                     28