🤖 AI Summary
Existing static performance analysis lacks lightweight, platform-agnostic metrics for compile-time performance estimation.
Method: We propose memory access count (MEMS) as a static performance proxy, implemented via Clang AST rewriting and source-level automatic instrumentation to embed path-wise MEMS modeling and counting logic directly into the code.
Contribution/Results: We systematically validate MEMS across ten classical algorithms. Experiments reveal— for the first time—that MEMS exhibits strong positive correlation with runtime performance *within* a given program across different execution paths, but weak correlation *across* distinct programs; this delineates MEMS’s practical applicability boundary. Crucially, MEMS incurs zero runtime overhead and requires no hardware-specific support, offering a portable, low-cost metric for static performance prediction. By bridging the gap between compile-time analysis and empirical performance behavior, MEMS significantly enhances the practicality of compiler optimizations and static performance modeling.
📝 Abstract
Static performance estimation is essential during compile-time analysis, yet traditional runtime-based methods are costly and platform-dependent. We investigate mems, the number of memory accesses, as a static and architecture-independent performance metric. We develop a Clang-based automated instrumentation tool that rewrites source code to insert path tracing and extit{mems} counting logic. This allows us to evaluate mems-based performance estimation across ten classical algorithm programs. Experimental results show that within the same program, execution paths with higher mems values consistently exhibit longer runtime. However, this correlation weakens between different programs, suggesting that mems is best suited for comparing performance of different execution paths in a program.