Profiling in the Presence of Optimization and Garbage Collection
Andrew W. Appel*
Bruce F. Duba+
David B. MacQueen+
Andrew P. Tolmach??
Profiling the execution of programs can be a great help in tuning their performance, and programs
written in functional languages are no exception. The standard techniques of callcounting and sta
tistical (interruptdriven) execution time measurement work well, but with some modification. In
particular, the program counter is not the best indicator of ``current function.'' Our profiler inserts
explicit increment and assignment statements into the abstract syntax tree representation, and is
therefore very simple to implement and completely independent of the intermediate code translator
and the codegenerator.
* Supported in part by NSF Grant CCR8806121 and by a Digital Equipment Corp. Faculty Incentive Grant.
+ AT&T Bell Laboratories, Murray Hill, NJ.
1. Execution profiling