On Sat, 19 Nov 2005, go moko wrote:
Hello
Just a question: During the installation of Bzip2, why
does the book use the bzip2-shared binary, instead of
the bzip2 binary installed by the 'make install'
command? The README of Bzip2 indicates that the bzip2
binary is better and recommand it.
Regards
G. Moko
Sorry for the late reply to this. As far as I can see, the developer
has two reasons for this stated preference -
(i) the shared program is not tested. Well, maybe somebody ought to fix
the testsuite (attached, but unlike the non-shared version this test
isn't run automatically). But, does anybody else care if bzip2 gets
tested ?
(ii) the shared version is slower (on platforms like x86 which lack an
adequate number of registers). This doesn't seem compelling to me - if
speed was that important, we'd still be using gcc-2.95.3.
For decompressing, the difference is not significant. On my duron
(1GHz, but PC100 memory, and a bit underpowered now) I used
both versions of bzip2 with -dc to take gcc-4.0.2.tar.bz2 (on an nfs
mount) and write it to a local file. That box is running an LFS-6.1
toolchain. Three runs of each, 58 seconds using bzip2, 58 to 61 seconds
with the shared version (variation < 4%).
If you compress a big dataset, then yes, the differences are more
significant. Using a 186M tarball from a partial system build, with a
sync before each test and two runs of each, user time varied from 3m32
(non-shared) to 3m52 (shared) which is about 9.5% slower.
So, if you reguarly compress large files with bzip2 on x86, you might
want to consider using the non-shared version to use a bit less time.
For most people, and for people using fast processors with fast memory,
it probably isn't worth using the non-shared version of bzip2.
Ken
--
das eine Mal als Tragödie, das andere Mal als Farce
Submitted By: Ken Moffat <ken at linuxfromscratch.org>
Date: 2005-12-03
Initial Package Version: 1.0.3
Upstream Status: not submitted
Origin: self
Description: Copied from the non-shared Makefile so that the shared version
can be tested.
--- bzip2-1.0.3/Makefile-libbz2_so.orig 2005-12-03 14:17:21.000000000 +0000
+++ bzip2-1.0.3/Makefile-libbz2_so 2005-12-03 14:24:23.000000000 +0000
@@ -42,3 +42,21 @@
$(CC) $(CFLAGS) -c decompress.c
bzlib.o: bzlib.c
$(CC) $(CFLAGS) -c bzlib.c
+
+check: test
+test: bzip2-shared
+ @cat words1
+ ./bzip2-shared -1 < sample1.ref > sample1.rb2
+ ./bzip2-shared -2 < sample2.ref > sample2.rb2
+ ./bzip2-shared -3 < sample3.ref > sample3.rb2
+ ./bzip2-shared -d < sample1.bz2 > sample1.tst
+ ./bzip2-shared -d < sample2.bz2 > sample2.tst
+ ./bzip2-shared -ds < sample3.bz2 > sample3.tst
+ cmp sample1.bz2 sample1.rb2
+ cmp sample2.bz2 sample2.rb2
+ cmp sample3.bz2 sample3.rb2
+ cmp sample1.tst sample1.ref
+ cmp sample2.tst sample2.ref
+ cmp sample3.tst sample3.ref
+ @cat words3
+
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page