-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Build] use pigz to speed up a build #12825
Conversation
Comparison.
new
It may depends from different factors, but I got 15-25% improvements in build time of final debian image (build_debian.sh) with pigz. Most noticeable changes here: |
can you make it optional so that people can try it out before we make it default? |
I think it's possible. I'll update this PR later then. |
Thanks for your suggestion. As you said, I also used this in the binary optimization PR. |
In fact I'm not sure that we really need this flag because it adds additional overhead to pass this flag to all files. |
BTW, there are some places we can also use pigz:
But need to check is it really a bottleneck like compressing dockerfs or not. Also one more interisting fact:
https://dev.azure.com/mssonic/be1b070f-be15-4154-aade-b1d3bfb17054/_apis/build/builds/185360/logs/64 |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it
It's possible to speed up some parts of a build using parallel compression/decompression.
This is especially important for build_debian.sh.
How I did it
pigz is a parallel implementation of gzip: https://zlib.net/pigz/
Some programs like docker and mkinitramfs can automatically detect and use it instead of gzip.
For tar we need to select it directly.
To enable this feature you need to set GZ_COMPRESS_PROGRAM=pigz