The function reordering algorithm, as a critical technique, improves program execution efficiency by reorganizing the function layout within the binary file. This study focuses on link time optimization and proposes a link time optimization algorithm based on cold-hot function reordering. The algorithm first extracts function call stack information using the performance analysis tool 'perf.' Then, it constructs a directed weighted graph of function calls based on factors such as call frequency, call relationships, and inter-function jump distances. Based on this graph, a function reordering algorithm is designed. A linking script is formulated, and finally, a linking tool is used to regenerate the optimized binary file. This approach aims to enhance code locality and optimize memory access patterns during execution. Experimental results demonstrate that this algorithm significantly increases instruction cache hit rates and instruction TLB hit rates while improving the overall program execution efficiency.
No takes yet. Share an insight, caveat, or question.
Li et al. (2024) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: