MapReplay: 基于跟踪的Java HashMap基准生成
MapReplay: Trace-Driven Benchmark Generation for Java HashMap
AI总结:
MapReplay结合应用基准的真实性和微基准的效率,生成能复现真实操作序列的基准,用于评估HashMap实现性能。
摘要:
基于哈希的映射,特别是java.util.HashMap,在Java应用和JVM中普遍存在,其性能至关重要。评估优化具有挑战性,因为性能取决于操作模式、键分布和扩容行为等因素。微基准测试速度快且可重复,但往往过于简化工作负载,无法捕捉到真实的使用模式。应用基准(如DaCapo、Renaissance)提供了真实使用,但运行成本更高,易受变量影响,并且受非HashMap计算主导,使得映射相关性能变化难以观察。为了解决这一挑战,我们提出MapReplay,一种结合应用基准真实性和微基准效率的基准方法。MapReplay追踪HashMap API使用,生成一个能够重现相同操作序列的回放工作负载,同时忠实重建内部映射状态。这使得在真实使用模式下对替代实现进行真实且高效的评估成为可能。将MapReplay应用于DaCapo-Chopin和Renaissance,所得到的套件MapReplayBench在重现应用级性能趋势的同时,减少了实验时间,并揭示了从完整基准中难以获得的见解。
英文摘要:
Hash-based maps, particularly java.util.HashMap, are pervasive in Java applications and the JVM, making their performance critical. Evaluating optimizations is challenging because performance depends on factors such as operation patterns, key distributions, and resizing behavior. Microbenchmarks are fast and repeatable but often oversimplify workloads, failing to capture the realistic usage patterns. Application benchmarks (e.g., DaCapo, Renaissance) provide realistic usages but are more expensive to run, prone to variability, and dominated by non-HashMap computations, making map-related performance changes difficult to observe. To address this challenge, we propose MapReplay, a benchmarking methodology that combines the realism of application benchmarks with the efficiency of microbenchmarks. MapReplay traces HashMap API usages generating a replay workload that reproduces the same operation sequence while faithfully reconstructing internal map states. This enables realistic and efficient evaluation of alternative implementations under realistic usage patterns. Applying MapReplay to DaCapo-Chopin and Renaissance, the resulting suite, MapReplayBench, reproduces application-level performance trends while reducing experimentation time and revealing insights difficult to obtain from full benchmarks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。