A program's cache performance can be improved by changing the organization and layout of its data---even complex, pointer-based data structures. Previous techniques improved the cache performance of these structures by arranging distinct instances to increase reference locality. These techniques produced significant performance improvements, but worked best for small structures that could be packed into a cache block.This paper extends that work by concentrating on the internal organization of fields in a data structure. It describes two techniques---structure splitting and field reordering---that improve the cache behavior of structures larger than a cache block. For structures comparable in size to a cache block, structure splitting can increase the number of hot fields that can be placed in a cache block. In five Java programs, structure splitting reduced cache miss rates 10--27% and improved performance 6--18% beyond the benefits of previously described cache-conscious reorganization techniques.For large structures, which span many cache blocks, reordering fields, to place those with high temporal affinity in the same cache block can also improve cache utilization. This paper describes bbcache, a tool that recommends C structure field reorderings. Preliminary measurements indicate that reordering fields in 5 active structures improves the performance of Microsoft SQL Server 7.0 2--3%.
[1]
Craig Chambers,et al.
Object-Oriented Multi-Methods in Cecil
,
1992,
ECOOP.
[2]
Craig Chambers,et al.
The cecil language: specification and rationale
,
1993
.
[3]
Craig Chambers,et al.
Whole-program optimization of object-oriented languages
,
1996
.
[4]
Roger F. Crew.
ASTLOG: A Language for Examining Abstract Syntax Trees
,
1997,
DSL.
[5]
Benjamin G. Zorn,et al.
BIT: A Tool for Instrumenting Java Bytecodes
,
1997,
USENIX Symposium on Internet Technologies and Systems.
[6]
Matthew L. Seidl,et al.
Segregating heap objects by reference behavior and lifetime
,
1998,
ASPLOS VIII.
[7]
Chandra Krintz,et al.
Overlapping execution with transfer using non-strict execution for mobile programs
,
1998,
ASPLOS VIII.
[8]
Chandra Krintz,et al.
Cache-conscious data placement
,
1998,
ASPLOS VIII.
[9]
James R. Larus,et al.
Using generational garbage collection to implement cache-conscious data placement
,
1998,
ISMM '98.
[10]
François Bodin,et al.
Improving cache behavior of dynamically allocated data structures
,
1998,
Proceedings. 1998 International Conference on Parallel Architectures and Compilation Techniques (Cat. No.98EX192).
[11]
James R. Larus,et al.
Cache-conscious structure layout
,
1999,
PLDI '99.