shared libraries [ was: Re: Fwd: Re: zlib-1.1.4 out - security fix ]

Bruce Dubbs bdubbs at
Thu Mar 14 16:49:49 PST 2002

Matthias Benkmann wrote:

> My runtime comparison used a small file that was compressed and
> decompressed a 1000 times. The times below should be dominated by startup
> time because the file was so small. The hard disk didn't play a major role
> because all of the test fit into the cache. However, hard disk accesses
> would likely only work to the disadvantage of the shared library, because
> this is the single-process case. So more hard disk influence would only
> make these numbers more pronounced. 
> Dynamic
> real    1m23.256s
> user    0m49.550s
> sys     0m33.620s
> Static
> real    1m16.193s
> user    0m44.200s
> sys     0m31.990s

I like your analysis, but lets look a the numbers from a practical.  The 
difference is  7 milliseconds per invocation.  That is not enough to 
make a decision about the merits of shared vs. static linking.

> The memory test used a large file. I ran it several times and monitored
> minigzip's growing memory consumption. The max. value was the same in all
> runs. Here are the results:
> Dynamic
> unzip 1428/480
> zip 4160/3240
> Static
> unzip 1412/464
> zip 4148/3228

Again, the max memory difference of 16Kb is not a deciding factor.  I 
call your experiment a virtual tie for speed/memory performance.

Other factors, not performance must be used when deciding to use shared 
or static linking.

   -- Bruce

Unsubscribe: send email to listar at
and put 'unsubscribe lfs-security' in the subject header of the message

More information about the lfs-security mailing list