[gambit-list] Question about performance of shared libraries on MacOS X

Bradley Lucier lucier at math.purdue.edu
Thu Jan 6 17:42:18 EST 2005


Marc:

As you guessed, once I downloaded the correct version of 
gambc40b12.tar.gz, my previously reported problems go away.

I have a question now about the performance of applications built with 
shared libraries on MacOS X.  When I configure gambit with 
--enable-shared --enable-single-host I get on my 2GHz G5 running MacOS 
10.3.6

[descartes:~/programs/gambc40b12/bench] lucier% ./bench gambit fft

Testing fft under Gambit-C
Compiling...
         0.95 real         0.77 user         0.16 sys
-rwxr-xr-x  1 lucier  lucier  30512  6 Jan 17:26 fft
Running...
(time (run-bench name count run ok?))
     3736 ms real time
     3000 ms cpu time (2970 user, 30 system)
     65 collections accounting for 29 ms real time (30 user, 0 system)
     671999504 bytes allocated
     no minor faults
     no major faults
         3.99 real         3.17 user         0.06 sys

(This is with the version of bench at

http://www.math.purdue.edu/~lucier/bench.tgz

which has some changes to the number of iterations each benchmark is 
run so that I get at least about 20 clock ticks on my G5.  It also 
changes ##fixnum.logand -> ##fixnum.bitwise-and, etc.  You may be 
interested in integrating the changes into your bench directory.)  I'm 
using gcc-3.4.3 since Apple's gcc-3.3 is just too slow compiling code 
generated by Gambit.  When I configure with just --enable-single-host 
(so with static libraries), I get

[descartes:~/programs/gambc40b12/bench] lucier% ./bench gambit fft

Testing fft under Gambit-C
Compiling...
         1.13 real         0.62 user         0.26 sys
-rwxr-xr-x  1 lucier  lucier  2478500  6 Jan 17:36 fft
Running...
(time (run-bench name count run ok?))
     1473 ms real time
     1140 ms cpu time (1130 user, 10 system)
     65 collections accounting for 29 ms real time (30 user, 0 system)
     671999504 bytes allocated
     no minor faults
     no major faults
         1.75 real         1.13 user         0.04 sys

Now that's a big difference.  And it's a big difference in code that 
does very few calls to the Gambit runtime.

Do you know why this is happening?  Do you know whether I should, say, 
statically link the Meroon object system with applications that use it 
to avoid a performance problem?  Or is there some type of prelink step 
for MacOS X that I can use to reduce this problem?

Brad



More information about the Gambit-list mailing list