An Efficient Profile-Analysis Framework for Data-Layout Optimizations

  • Shai Rubin ,
  • Rastislav Bodík ,
  • Trishul Chilimbi

Proceeding POPL '02 Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages |

Published by ACM SIGPLAN

Publication

Data-layout optimizations rearrange fields within objects, objects within objects, and objects within the heap, with the goal of increasing spatial locality. While the importance of data-layout optimizations has been growing, their deployment has been limited, partly because they lack a unifying framework. We propose a parameterizable framework for data-layout optimization of general purpose applications. Acknowledging that finding an optimal layout is not only NP-hard, but also poorly approximable, our framework finds a good layout by searching the space of possible layouts, with the help of profile feedback. The search process iteratively prototypes candidate data layouts, evaluating them by “simulating” the program on a representative trace of memory accesses. To make the search process practical, we develop space-reduction heuristics and optimize the expensive simulation via memorization. Equipped with this iterative approach, we can synthesize layouts that outperform existing non-iterative heuristics, tune application-specific memory allocators, as well as compose multiple data-layout optimizations.