2019独角兽企业重金招聘Python工程师标准>>>
Most programs require libraries to function. Libraries can be integrated into a program once, by a linker, when it is compiled (static linking) or they can be integrated when the program is run by a loader, (dynamic linking). Dynamic linking has advantages in code size and management, but every time a program is run, the loader needs to find the relevant libraries. Because the libraries can move around in memory, this causes a performance penalty, and the more libraries that need to be resolved, the greater the penalty. prelink reduces this penalty by using the system's dynamic linker to reversibly perform this linking in advance ("prelinking" the executable file) by relocating. Afterward, the program only needs to spend time finding the relevant libraries on being run if, for some reason (perhaps an upgrade), the libraries have changed since being prelinked.
更多:http://en.wikipedia.org/wiki/Prelink
许多的应用程式使用共用函式库. 在这些程式被执行的时候, 共用函式库会被读进记忆体中, 并且跟程式中所参用到的符号(symbol)连结起来. 对大多的小程式而言, 通常这样的动态连结非常快. 但是对一些依存於大量函式库的C++ 程式而言, 动态连结却可能花上不少的时间.
在大多数的系统上, 函式库并不会常常被更动, 每次程式被执行时所进行的连结动作都是完全相同的,Prelink 利用这点, 将程式与函式库连结的方式弄出来记录在执行档中, 达成"预先连结"的效果. 你需要glibc 中的ld-linux.so 来进行连结, 要能够认出"预先连结"的纪录则需要 >=glibc-2.3.1-r2.
"预先连结" 能够节省应用程式的启动时间. 以典型的KDE 程式为例, 程式的读取时间能够减少50% 那么多. 唯一必要的维护只有每当被"预先连结"过的执行档所连结到的函式库有所更新时, 需要再次执行prelink.
更多:http://blog.linuxeden.com/index.php/219759/viewspace-7539.html