faster bzip2

Robert Connolly robert at linuxfromscratch.org
Mon Mar 1 01:32:06 PST 2010


Hi.

This patch builds bzip2 with profile guided optimization, the --combine 
option, and -fomit-frame-pointer:
http://www.linuxfromscratch.org/~robert/new/patches/bzip2-1.0.5-faster.diff

The non-shared bzip2 program decompresses 7% faster for me, without accounting 
for -fomit-frame-pointer. The libbz2.so library runs 4.5% faster for me. The 
profiling optimization works a lot better when the all the code is built 
together, so the non-shared bzip2 program is suggested. So:
cp -v bzip2 /bin/bzip2 # Not bzip2-shared

I also tried other options like -fwhole-program, -O3, and -finline-functions, 
and they made bzip2 and the library slower. My tests were only with 
decompression, of a gcc tarball, but compression should also be faster.

There are also other bzip2 packages that do parallel/multithread compression, 
but not parallel decompression.

robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-chat/attachments/20100301/4df4d9bb/attachment.sig>


More information about the lfs-chat mailing list