2006 · 12 citations · 18 references
ComputingComputer EngineeringComputer ScienceAlgorithmsCompilersProgramming LanguagesData Locality OptimizationDynamic ProgrammingJust-in-time CompilationPerformance OptimizationRuntime EnvironmentsApplication Performance OptimizationDynamic LoadingDynamic RecompilationManaged Runtime SystemsMethod InstructionPlacement AlgorithmsSpatial LocalityTiling Strategies
Poor code locality degrades application performance by increasing memory stalls due to instruction cache and TLB misses. This problem is particularly an issue for large server applications written in languages such as Java and C# that provide just-in-time (JIT) compilation, dynamic class loading, and dynamic recompilation. However, managed runtimes also offer an opportunity to dynamically profile applications and adapt them to improve their performance. This paper describes a Dynamic Code Management system (DCM) in a managed runtime that performs whole program code layout optimizations to improve instruction locality.We begin by implementing the widely used Pettis-Hansen algorithm for method layout to improve code locality. Unfortunately, this algorithm is too costly for a dynamic optimization system, O(n3) in time in the call graph. For example, Pettis-Hansen requires a prohibitively expensive 35 minutes to lay out MiniBean which has 15,586 methods. We propose three new code placement algorithms that target ITLB misses, which typically have the greatest impact on performance. The best of these algorithms, Code Tiling, groups methods into page sized tiles by performing a depth-first traversal of the call graph based on call frequency. Excluding overhead, experimental results show that DCM with Code Tiling improves performance by 6% on the large MiniBean benchmark over a baseline that orders methods based on invocation order, whereas Pettis-Hansen placement offers less improvement, 2%, over the same base. Furthermore, Code Tiling lays out MiniBean in just 0.35 seconds for 15,586 methods (6000 times faster than Pettis-Hansen) which makes it suitable for high-performance managed runtimes.
18
Profile guided code positioning
Karl Pettis, Robert C. Hansen, Jack W. Davidson · ACM SIGPLAN Notices · 2004 · 393 citations
Profile guided code positioning
Karl Pettis, Robert C. Hansen · 1990 · 293 citations · Full text
Program optimization for instruction caches
Scott McFarling · 1989 · 171 citations · Full text
The garbage collection advantage
Xianglong Huang, Stephen M. Blackburn, Kathryn S. McKinley et al. · 2004 · 159 citations