A framework for reducing the cost of instrumented code
Authors:
Open Access
- 1 May 2001
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 36 (5) , 168-179
Abstract
Instrumenting code to collect profiling information can cause substantial execution overhead. This overhead makes instrumentation difficult to perform at runtime, often preventing many known offline feedback-directed optimizations from being used in online systems. This paper presents a general framework for performing instrumentation sampling to reduce the overhead of previously expensive instrumentation. The framework is simple and effective, using code-duplication and counter-based sampling to allow switching between instrumented and non-instrumented code. Our framework does not rely on any hardware or operating system support, yet provides a high frequency sample rate that is tunable, allowing the tradeoff between overhead and accuracy to be adjusted easily at runtime. Experimental results are presented to validate that our technique can collect accurate profiles (93-98% overlap with a perfect profile) with low overhead (averaging 6% total overhead with a naive implementation). A Jalape~ no-specific optimization is also presented that reduces overhead further, resulting in an average total overhead of 3%.Keywords
This publication has 27 references indexed in Scilit:
- Adaptive optimization in the Jalapeño JVM2000
- Practicing JUDO2000
- Dynamo2000
- The Jalapeño dynamic optimizing compiler for Java1999
- Fast, effective code generation in a just-in-time Java compiler1998
- Exploiting hardware performance counters with flow and context sensitive profiling1997
- Reconciling responsiveness with performance in pure object-oriented languagesACM Transactions on Programming Languages and Systems, 1996
- Optimally profiling and tracing programsACM Transactions on Programming Languages and Systems, 1994
- Profile‐guided automatic inline expansion for C programsSoftware: Practice and Experience, 1992
- Debugging optimized code with dynamic deoptimization1992