Optimization coaching: optimizers learn to communicate with programmers

Optimizing compilers map programs in high-level languages to high-performance target language code. To most programmers, such a compiler constitutes an impenetrable black box whose inner workings are beyond their understanding. Since programmers often must understand the workings of their compilers to achieve their desired performance goals, they typically resort to various forms of reverse engineering, such as examining compiled code or intermediate forms. Instead, optimizing compilers should engage programmers in a dialog. This paper introduces one such possible form of dialog: optimization coaching. An optimization coach watches while a program is compiled, analyzes the results, generates suggestions for enabling further compiler optimization in the source program, and presents a suitable synthesis of its results to the programmer. We present an evaluation based on case studies, which illustrate how an optimization coach can help programmers achieve optimizations resulting in substantial performance improvements.

[1]  Michael Wolfe,et al.  Loops skewing: The wavefront method revisited , 1986, International Journal of Parallel Programming.

[2]  Ondrej Lhoták,et al.  Integrating the Soot Compiler Infrastructure into an IDE , 2004, CC.

[3]  Erik R. Altman,et al.  Performance analysis of idle programs , 2010, OOPSLA.

[4]  Brian Hackett,et al.  Fast and precise hybrid type inference for JavaScript , 2012, PLDI '12.

[5]  Manuel Serrano Inline Expansion: When and How? , 1997, PLILP.

[6]  Shan Lu,et al.  Understanding and detecting real-world performance bugs , 2012, PLDI.

[7]  Nicholas C. Zakas High Performance JavaScript , 2010 .

[8]  Paul Hudak,et al.  ORBIT: an optimizing compiler for scheme , 1986, SIGPLAN '86.

[9]  Kurt Wall,et al.  The Definitive Guide to GCC , 2004, Apress.

[10]  Saturnino Garcia,et al.  Kremlin: rethinking and rebooting gprof for the multicore age , 2011, PLDI '11.

[11]  David Grove,et al.  Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis , 1995, ECOOP.

[12]  Christopher W. Fraser,et al.  A Retargetable C Compiler: Design and Implementation , 1995 .

[13]  Colt McAnlis,et al.  High-Performance JavaScript , 2014 .

[14]  Donald E. Knuth,et al.  An empirical study of FORTRAN programs , 1971, Softw. Pract. Exp..

[15]  Matthias Hauswirth,et al.  Catch me if you can: performance bug detection in the wild , 2011, OOPSLA '11.

[16]  Sam Tobin-Hochstadt,et al.  Languages as libraries , 2011, PLDI '11.

[17]  Matthias Felleisen,et al.  Debugging hygienic macros , 2010, Sci. Comput. Program..

[18]  Andrew W. Appel,et al.  Continuation-passing, closure-passing style , 1989, POPL '89.

[19]  Laurie J. Hendren,et al.  Optimizing Java Bytecode Using the Soot Framework: Is It Feasible? , 2000, CC.

[20]  Sam Tobin-Hochstadt,et al.  Typing the Numeric Tower , 2012, PADL.

[21]  Matthias Felleisen,et al.  Modeling an Algebraic Stepper , 2001, ESOP.

[22]  Simon L. Peyton Jones,et al.  Compiling Haskell by Program Transformation: A Report from the Trenches , 1996, ESOP.

[23]  Jong-Deok Choi,et al.  Finding and Removing Performance Bottlenecks in Large Systems , 2004, ECOOP.

[24]  M. F.,et al.  Bibliography , 1985, Experimental Gerontology.

[25]  Andrew W. Appel,et al.  A type-based compiler for standard ML , 1995, PLDI '95.

[26]  Laurie J. Hendren,et al.  A Comprehensive Approach to Array Bounds Check Elimination for Java , 2002, CC.

[27]  Xavier Leroy,et al.  Unboxed objects and polymorphic typing , 1992, POPL '92.

[28]  Matthias Felleisen,et al.  Catching bugs in the web of program invariants , 1996, PLDI '96.

[29]  David W. Binkley,et al.  The feedback compiler , 1998, Proceedings. 6th International Workshop on Program Comprehension. IWPC'98 (Cat. No.98TB100242).

[30]  Jennifer Elizabeth Shaw VISUALIZATION TOOLS FOR OPTIMIZING COMPILERS , 2005 .

[31]  P. A. W. Lewis,et al.  A Pseudo-Random Number Generator for the System/360 , 1969, IBM Syst. J..

[32]  Matthias Felleisen,et al.  DrScheme: a programming environment for Scheme , 2002, J. Funct. Program..

[33]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .