EP1475705A2

Optimizing cache efficiency within application software

Abstract

The present invention finds the optimum organization of compiled code within an application to ensure maximal cache efficiency. A configuration file specifies predefined cache, optimization, and application parameters. The cache parameters include a cache size, cache line size, set associativity, address-to-cache-line mapping algorithm, and set replacement algorithm. The optimization parameters specify the minimum acceptable efficiency level. The application parameters include a list of object modules and functions within those modules. All possible orderings of the modules are stepped through to determine where the specified functions fall within the cache given the location of the function within the module. The function locations in each permutation of the orderings are analyzed to find a solution that matches or beats the optimization parameters. In an embodiment, a front-end analysis program ("tool") and a back-end processing stage, usually related to a linker, are provided. The tool reads the configuration file, analyzes the application, and recommends the optimal solution. In an embodiment, a development tool can be used instead of the front-end analysis tool. In another embodiment, a linker or a post-processing stage can be used to place the important functions adjacent to each other in cache.

EP1475705A2, drawing sheet 1
Sheet 1 of 15

Term

Term ended

Projected expiry passed 8 April 2024, 2.5 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

10 claims: 8 independent, 2 dependent

  1. 1
    A method for optimizing cache efficiency, comprising the steps of:receiving an application that includes a plurality of functions, said functions including compiled code, which are executed by a processor;locating each function;ordering said functions for placement in a cache memory, wherein said ordering is repeated until reaching a specified stopping point, wherein each permutation of said ordering produces a unique ordered sequence;andevaluating the efficiency of each permutation of said ordering.
  2. 4
    A method for optimizing cache efficiency, comprising the steps of:receiving an application that includes a plurality of object modules, each object module comprising one or more functions, said one or more functions including compiled code, which are executed by a processor;ordering said object modules for placing said one or more functions in a cache memory, wherein said ordering is repeated until reaching a specified stopping point, wherein each permutation of said ordering produces a unique ordered sequence;evaluating the efficiency of each permutation of said ordering;andselecting a permutation that does not violate a specified optimization parameter to thereby to optimize said cache memory.
  3. 5
    A method for optimizing cache efficiency, comprising the steps of:accessing a plurality of information sets;producing a plurality of arrangements for placing said information sets in a cache memory;andevaluating the efficiency of said arrangements to detect an optimum arrangement.
  4. 6
    A method for optimizing cache efficiency, comprising the steps of:producing a plurality of arrangements for placing a plurality of functions in a cache memory, said functions comprising code for an application program;analyzing one of said arrangements to determine the quantity of said functions within said arrangement that hits each cache line of said cache memory;andselecting said arrangement as an optimum arrangement in response to determining the quantity of hits for each cache line from said analyzing step does not exceed a specified threshold value.
  5. 7
    A method for optimizing cache efficiency, comprising the steps of:producing a plurality of arrangements for placing a plurality of functions in a cache memory, said functions comprising code for an application program;analyzing one of said arrangements to determine the quantity of said functions within said arrangement that hits each cache line of said cache memory;andselecting said arrangement as an optimum arrangement in response to determining the quantity of hits for each cache line from said analyzing step does not exceed a specified first parameter, and in response to determining the total cache lines having hits from said analyzing step equal to said specified first parameter do not exceed a specified second parameter.
  6. 8
    A method for optimizing cache efficiency, comprising the steps of:producing a plurality of arrangements for placing a plurality of functions in a cache memory, said functions comprising code for an application program;analyzing one of said arrangements to determine the quantity of said functions within said arrangement that hits each cache line of said cache memory;andselecting said arrangement as an optimum arrangement in response to determining the quantity of hits for each cache line from said analyzing step does not exceed a specified first parameter, and in response to determining the total cache lines having hits from said analyzing step exceeding the cache set associativity do not exceed a specified second parameter.
  7. 9
    A method for optimizing cache efficiency, comprising the steps of:producing a plurality of arrangements for placing a plurality of information sets in a cache memory;analyzing said arrangements to select an optimum arrangement in response to determining said optimum arrangement complies with a specified optimization parameter;andenabling modifications to said specified optimization parameter to produce a second value for said specified optimization parameter in response to determining that no arrangement complies with the first value of said specified optimization parameter, wherein said analyzing step is executed with said second value.
  8. 10
    A method for optimizing cache efficiency, comprising the steps of:accessing a plurality of functions, said functions comprising code for an application program;identifying the important functions from said plurality of functions;andoperating a linker to optimally place said important functions in a cache memory such that said important functions are adjacent to each other in cache.