Cache-Conscious Structure Definition

Trishul M. Chilimbi, Bob Davidson, and James R. Larus

Abstract

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%.

Details

Publication typeInproceedings
Published inProceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation
URLhttp://doi.acm.org/10.1145/301618.301635s
Pages13-25
AddressAtlanta, GA
PublisherACM
> Publications > Cache-Conscious Structure Definition