Optimizing for disk cache?

Stefan Heimers kde-optimize@mail.kde.org
Tue, 14 Jan 2003 09:43:05 +0100


I came up with an idea how to optimize for disk cache:

When linking, group objects in three parts in the following order:

1. Objects used in every program at startup, before user interaction, in 
order of first call.

2. Objects often used, group objects often used together

3. Objects rarely used or obsolete


My question: Does the gnu linker change the order of object files, or 
does it put them into the *.so or executable in order of their 
appearence on the command line?

I found out that my idea is not really new, there are tools to automate 
this process, but they are either commercial or hard to find/use.

There is a free tool named grope, I found a description, but no code:
 http://lwn.net/1998/1029/als/rope.html

There is a commercial tool for SGI IRIX, named cord:
 http://www.chemie.fu-berlin.de/cgi-bin/man/sgi_irix?cord+1

SCO has a tool called fur:
 http://uw7doc.sco.com/SDK_cdebug/_Using_fur_to_Perform_Block_Prof.html

The intel compiler has the ability to use runtime profiling feedback for 
optimizing binaries.

For the GNU compiler similar options are being worked on, or might 
already be ready in newer versions, I didn't check for some time. Here 
is a description of the GNU version:

 http://www.gnu.org/software/gcc/news/profiledriven.html


Stefan

-- 
http://speedup.superhits.ch/