A method for optimizing (re-structuring) data layout for 1) local or
global variables and/or 2) fields of a structure or object and/or 3)
function pointers in a virtual function table in a compiled program is
based on profile feedback. A user, such as a software programmer,
identifies one or more classes of data elements in an application that
the user wishes to optimize. A method, which may be implemented in a
software program such as a compiler, analyzes the profile for the
designated data elements to determine, based on the application's
temporal behavior, how to order the designated data elements in order to
optimize data cache performance.