Speeding up sbuild / PPA / distro builds (optiPNG)
michal.sawicz at canonical.com
Fri Jun 21 21:22:47 UTC 2013
There are times, when you *really* want for a package to build
already... It's almost there... the tests passed... the package is
built! And then optiPNG kicks in and takes 33 minutes ( vs. ) to
For unity8 that time was Tuesday night - it took some 25 minutes to
build the package on armhf and then pkgbinarymangler went ahead and
optimized the PNGs, which on a pandaboard took another half an hour.
On the plus side, this saved us 571kB in image size (or 9.4%).
But it's done for every package build, for each architecture separately
- the time sacrifice was just too big. It doesn't have to be!
See , which is:
$ optipng -o7 `find -name *png`
Because of -o7 (slowest) we saved another 112kB, or 2%. Then, added
export NO_PNG_PKG_MANGLE=1 to debian/rules and voilá! that's a _lot_ of
our pandas' time saved.
The drawback is that you need to remember to optimize the PNGs when
adding new ones or changing them. It could be possible to mark the
already-optimized PNGs somehow (tagging comes to mind, but that would
usually survive modifications), so that we don't re-optimize them again
during pkgbinarymangle? We could probably use some manifest, but that
would mean shipping it in the binary package (is it possible to ship in
DEBIAN/ so that it isn't installed anywhere?), and we'd need to make
sure modified files are not omitted, so some kind of checksum would need
to be used - still much faster than optipng, probably...
Anyway! I recommend to all and everyone to consider pre-optimizing their
PNGs (that might be the case for other image formats / files as well,
not sure what else pkgbinarymangler  does). It might save you time,
the builders time, save power, trees, babies, baby pandas and bunnies.
Have a good weekend, people!
Michał (Saviq) Sawicz <michal.sawicz at canonical.com>
Canonical Services Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 899 bytes
Desc: OpenPGP digital signature
More information about the ubuntu-devel