More LiveCD space optimizations

John McCabe-Dansted gmatht at gmail.com
Wed Oct 6 16:08:17 UTC 2010


In May, Louis Simard proposed rencoding PNG files and SVG files to
reduce their size [1]. I note that we can save further space by:

1) Using advdef on the png files in addition to optipng. This is what
optimizegraphics does, and this shrinks the pngs on the Maverick RC
liveCD from about 100.1MB to 85.3MB providing a saving of 14.8MB.
2) Recompressing gz files with advdef. Using advdef, we can shrink the
gz files from 89.5MB to 84.8MB, and provides a saving of 4.7MB.
3) Recompressing jpeg files with jpegrescan. This only saves 0.5MB,
but implementing this would add just a couple more lines of code, and
jpegrescan does not lose any picture quality [2].

Together these should shrink the liveCD by over 20MB. This is without
even considering the .xml and .svg optimizations Louis proposed.

A further 10MB could be saved by recompressing the gz files as lzma.
This seems reasonable as lzma has reasonable decompression times (e.g.
7ms to decompress a largish manpage like lsof). Since the liveCD is
compressed anyway, it seems that if a file is compressed with gzip. it
is worth compressing with lzma.  The command "man" already seems to
have lzma support, but we'd want to test each application to ensure
that it functions correctly when its .gz files are replaced with lzma
files. We could also selectively recompress the gz files, as some .gz
files are actually smaller (by about 40 bytes) than the corresponding
lzma file.

Given that recoding SVG files can save 7MB [1], simply recoding files
could free up 37MB for the Natty LiveCD (and presumably also reduce
the the average size of debs in the repos by about 5%).

[1] http://www.mail-archive.com/ubuntu-devel-discuss@lists.ubuntu.com/msg11337.html
[2] http://news.ycombinator.com/item?id=803839

I attach the script I used to check how much space would be saved.
This is purely for reproduction of my results, it is not integrated
into Louis's script.

-- 
John C. McCabe-Dansted
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lossless_recompression_iso.sh
Type: application/x-sh
Size: 1425 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20101007/10cf5742/attachment.sh>


More information about the Ubuntu-devel-discuss mailing list