发明名称 Profiling binary code based on density
摘要 The technology is directed to profiling binary code based on a computed “density” of functions in the code. The density of a function can be computed as the frequency of execution of the function divided by the size of the function. Functions that execute more often and are smaller in size (“dense functions”) are moved towards the “front” (e.g., beginning) of the binary code. The frequency of execution can be measured at runtime using a performance measurement tool without requiring modification of the binary code or corresponding source code. After density is computed (e.g., over a period of time) for functions, it can be used to cause linkers to rearrange the binary code to place denser functions closer to the “front” of the binary code. By loading denser functions first (e.g., into processor caches and translation lookaside buffer (“TLB”)), the technology reduces cache and TLB misses, and thereby improves system performance.
申请公布号 US9342283(B2) 申请公布日期 2016.05.17
申请号 US201414179246 申请日期 2014.02.12
申请人 Facebook, Inc. 发明人 Maher Bertrand Allen
分类号 G06F9/45 主分类号 G06F9/45
代理机构 Perkins Coie LLP 代理人 Perkins Coie LLP
主权项 1. A method performed by a computing device, comprising: obtaining profile data from execution of a binary code of an application on the computing device, the profile data including multiple density values indicating a density of multiple functions in the binary code, wherein the density of a first function of the functions is computed based on a frequency of execution of the first function and the size of the first function, wherein the frequency of execution is determined based on at least a percentage of runtime of the application consumed by the first function; providing the density values to a linker; modifying, by the linker, the binary code based on the density of the functions to generate a modified binary code, the modifying rearranging functions in decreasing order of density; and loading, by the linker, the modified binary code to a memory of the computing device for execution, wherein loading the modified binary code includes clustering functions with density above a specified threshold at a lower address range of the memory.
地址 Menlo Park CA US