ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #02521
Speeding up sbuild / PPA / distro builds (optiPNG)
Hey all,
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 ([1] vs. [2]) to
finish...
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 [3], 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 [4] does). It might save you time,
the builders time, save power, trees, babies, baby pandas and bunnies.
For real!
[1] https://launchpad.net/~phablet-team/+archive/ppa/+build/4729025
[2] https://launchpad.net/~phablet-team/+archive/ppa/+build/4735955
[3] https://code.launchpad.net/~saviq/unity/8.optimize-pngs/+merge/170619
[4] https://launchpad.net/pkgbinarymangler/
Have a good weekend, people!
--
Michał (Saviq) Sawicz <michal.sawicz@xxxxxxxxxxxxx>
Canonical Services Ltd.
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups