Performance research

David Naylor naylor.b.david at
Thu Apr 24 20:21:21 UTC 2008


(If you want to skip to the questions (since this is a questions mailing 
list :-) please see the 2nd last paragraph)

I am interested in the performance difference of using either -Os or -O2.  
From my preliminary research I have found that in most cases -Os 
outperforms -O2 (and produces smalled binaries).  

However this is only in a very isolated situation and does not make any case 
for a system wide change therefore I would like to run some experiments to 
measure the difference between the two flags.  

I plan to use a live CD (with a system using 3GB) and having both the source 
and object tree in memory (so as to avoid the harddrive influencing the 
times).  Since the CD is very small I am expecting caching to eliminate any 
influence of the slow CD read times of any of the files required to build 

The tests will be automated by scripts with two CD's, the first with -Os and 
the second with -O2 binaries for the kernel and world (both amd64).  I am 
running an Intel Core 2 Duo 2.2 and 3GB of ram (as mentioned before).  I am 
hoping that only the execution speed will be measured without any other 
factors influencing (such a lack of memory [and thus -Os having the 
advantage]) the results.  

Onto the questions:
1) Is there any other (better) tool I should use to measure the performance of 
building world (other than time)?
2) Since (I think) all of FreeBSD sources of aliassing safe (I have been 
running a system without -fno-strict-aliassing and optimised for a while 
without a problem) should I leave it out of the build flags (i.e. 
CFLAGS=-Os -pipe)
3) Any other suggestions on refining this experiment?
4) Should this experiment produce potential, or conclusive, results any other 
suggestions of experiments to run (perhaps a database or other flags?) 

I will be posting my results (possible wiki page, or a particular mailing 
list) after this weekend.  

Thank you for your time.  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part.
Url :

More information about the freebsd-questions mailing list