Consider enabling the BCJ filter when packaging bundles.
xz (and xz embedded) supports branch/call/jump filters that is supposed to reduce compressed executable size. The documentation hints that the compression ratio can end up being worse in certain situations, but as far as I can tell, it helps.
Numbers (tested with
- Current settings: 43667412 (1.0)
xz -9: 43463244 (0.99)
xz --x86 --lzma2: 42621816 (0.976)
xz --x86 --lzma2=preset=9: 42402308 (0.971)
The "extreme" setting doesn't help the bundle compression enough to be worth it, and it would increase the already long build time even further.
The improvement isn't absolutely massive, but ~1 MiB is ~1 MiB. Since we only currently build x86(_64) bundles, adding
export XZ_OPT="--x86 --lzma2" or similar to the top of
dtar.sh should be sufficient, adjust presets to taste.
(There is also an Little Endian ARM BCJ filter, along with filters for architectures that we don't care about.)