Matty wrote: > On Wed, Apr 30, 2008 at 6:26 PM, David Lutz <[EMAIL PROTECTED]> wrote: > > If your application is single threaded, you could try using the > > bsdmalloc library. This is a fast malloc, but it is not multi-thread > > safe and will also tend to use more memory than the default > > malloc. For a comparison of different malloc libraries, look > > at the NOTES section at the end of umem_alloc(3MALLOC). > > > > I got the following result with your example code: > > > > > > $ gcc -O3 -o xml `/usr/bin/xml2-config --libs --cflags` xml.c > > $ ./xml > > 100000 iter in 21.445672 sec > > $ > > $ gcc -O3 -o xml `/usr/bin/xml2-config --libs --cflags` xml.c -lbsdmalloc > > $ ./xml > > 100000 iter in 12.761969 sec > > $ > > > > I got similar results using Sun Studio 12. > > > > Again, bsdmalloc is not multi-thread safe, so use it with caution. > > Thanks David. Does anyone happen to know why the memory allocation > libraries in Solaris are so much slower than their Linux counterparts? If > the various malloc implementations were a second or two slower, I could > understand. But they appear to be 10 - 12 seconds slower in our specific > test case, which seems kinda odd.
Could you try an experiment and compile you sources with /usr/lib/libast.so.1 (you need to compile the sources with -I/usr/include/ast before /usr/include/ since libast uses a different symbol namespace and cannot be used to "intercept" other |malloc()|/|free()| calls like libbsdmalloc) ? AFAIK that should cure the performance problem (assuming the library functions which heavily use |malloc()|/|free()| are compiled against libast headers, too) ... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [EMAIL PROTECTED] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL <currently fluctuating> (;O/ \/ \O;) _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org