[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Optimization for slow platforms



Marco d'Itri wrote:

> If the programs are linked statically then they will have the same
> memory footprint of programs linked with non-PIC libraries, so the
> situation will not be worse in this sense.

On non-i386 architectures, I will turn on --enable-dynamic to link to
the current PIC library.  There’s no good reason not to.

Neglecting xzdec and lzmadec, [*] the only binaries in the xz-utils
package are xz and lzmainfo.

For i386, there are three obvious options:

1. Use the default settings (as I do now).  That means xz links to
   static liblzma and lzmainfo is dynamically linked to the PIC liblzma.

2. Build a non-PIC liblzma and link everything to it.

3. Build a PIC liblzma and link everything to it.

The cost of doing 1 over 3: we waste around 128 KiB of disk space for
the xz binary and about 128 KiB of nonsharable text for each xz
instance.

The cost of 2 is potentially higher.  There has to be another copy of
the approx 128 KiB of nonsharable text for every process that uses
liblzma.  Plus it adds to the startup time and can hurt the security
of every process linking to it.

Jonathan

[*] Why?  Because they should not be in the xz-utils package anyway.
Put together, they are much smaller than liblzma, and that is the only
reason for them to exist.


Reply to: