[Libreoffice] Windows installer size reduction effort - the compression theory

Kálmán „KAMI” Szalai kami911 at gmail.com
Tue Feb 22 08:32:15 PST 2011

Hi Michael and Friends of LibreOffice,

I ran few test to figure out what is the best method for installset
compressing (se the attached document and diagram). I cheated a bit,
because I used the tools (7z, zip, cabmake) and I didn't modified build
environment. So I downloaded LibO_3.3.1rc2_Win_x86_install_multi.exe and
extracted it. I found that unpacked cab file is the best if we repack it
with LZMA but it is unbalanced because the preinstalled installation kit
is more than 700MB.
So I went to other direction, whatif I increase the efficiency of LZM
compression of makecab. I found that we can use .Set CompressionMemory=
21 setting. This setting produces 83,91% of original installer size and
if we combine it with a simple zip compression the download size can
reduce to 83,54%. This scenario is represented by blue color and the
gain was 36 MB! I think the compression time is not much higher and the
installation time is not increased critically. The preinstallation time
decreased so I think this is an interesting opportunity to reduce the
windows installer's size. What is your opinion? Of course I tried
several other method, but this compilation of compression algorithms
produces the best overall appearance. In the gray section I tried a
special way when I uncompressed every zip container (ODF, JAR, ZIP, etc)
in the installset and every file contains only stored data without
compression. In this way I was able to gain more 15 MB, but this require
zip recompressing at the end of installation process that may make it to
complex and time consuming. Please check the attached document, and if
you want to go with it apply the attached patches.

All the best,

2011-02-21 10:42 keltezéssel, Michael Meeks írta:
> Hi Kalman,
> On Sun, 2011-02-20 at 15:15 +0100, Kálmán „KAMI” Szalai wrote:
>> I am sure we can shrink the installer more with better compression
> 	Hah - so, of course Fridrich and Tor have looked into this - and
> naturally you are right :-) there is a lot we can do. Clearly
> compressing things badly first, and then well later (eg. zip, then lzma)
> doesn't give the best results. That is particularly so when there are
> lots of similarities in the eg. un-compressed ODF files we have
> internally for eg. templates but minor differences that will have
> hard-to-compress knock-on-effects in the compressed stream.
> 	The ideal would be to use only one level of compression - using the
> best algorithm (LZMA) ie. NSIS, and nothing in the .cab file (which is
> limited to various lame algorithms, and perhaps per-contained-file
> compression, rather than per-whole-cab-file).
> 	Unfortunately, with the currently level of eg. template duplication,
> this would give us a vast .cab file that would chew lots of space on the
> target machine - though it might shrink our download nicely :-)
>> What is your opinion? Can somebody test it on a real Windows build
>> system? 
> 	The current balance is based on testing; quite possibly there is a
> better set of compression options - but we need to work out what it is.
> Our current settings are optimised for a multi-lang install as we ship
> it. To change that I'd like to see a table:
> New options 	Download/kb	Install/kb
> 	with the relevant sizes of both of these guys. That is just a matter of
> running lots of long builds and comparing the output I guess, and I
> suspect we will get something like a trade-off between these two values.
> 	Clearly, the 'real' solution is engineering to stop us having so much
> pointless duplication ;-)
> 	HTH,
> 		Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LibO - Compression tests.ods
Type: application/vnd.oasis.opendocument.spreadsheet
Size: 23631 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110222/7ce9dde7/attachment-0001.ods>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Windows-installer-compression-optimization-bootstrap.patch
Type: text/x-patch
Size: 1010 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110222/7ce9dde7/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Windows-installer-compression-optimization-components.patch
Type: text/x-patch
Size: 896 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110222/7ce9dde7/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110222/7ce9dde7/attachment-0001.pgp>

More information about the LibreOffice mailing list