This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
Inefficiencies in the build process #41
Labels
chat: brainstorming
Wild ideas to spur on the inspiration.
Spent a couple of hours mapping out the build process and little tweaks that can help a lot to the overall experience and performance.
Create root
Not much value in making it parallel and just ensure all the directories are available for next steps.
tmpfs
. Many writes saved and blitting/caching is a lot faster! Easy 1-2s on builds with many deps.Fetching upstreams and packages
The ideal would be to fetch index and start fetching upstreams while calculating deps and packages to also fetch. A lot of hassle really (and we go back to that
moss-jobs
style overhead) if we simply make the index fetch and dep calc fast we can get most gains even with the current approach and the following modifications.This mixes up
moss
andboulder
work queues so would need a refactor if it's worth implementing at all.This is only within
moss
Build stages
Most areas to speed up are via clang and options so won't be explored here. Still a couple of options.
fakeroot
optional. Two options, makefakeroot
only for theinstall
stage which will save 95% of the overhead. Then can only create files in install, duringinstall
stage. Alternatively make it opt in and overhaul file permissions inmoss-format
to handle it.Analyse
This needs quite an overhaul to handle our coming requirements (and stop reading files twice). The benefit of not reading files twice doesn't save that much time but opens new opportunities with a refactor.
rundeps
, but to manually add a provider. Can cut a lot of code to handle the ld additions inglibc
and then easily support all future compat-symlink providers (and there will be quite a few).clang
without it (hasWl,-q
relocation info in it)llvm-objcopy
to save a call tollvm-strip
-R .comment
I've also considered switching from the sieve based approach to directly operating on files that the sieve target (they're pretty specific) rather than iterating each file. But provided we get isELF, hasHashBang on first read, iterating a sieve becomes basically costless and the alternative is hard to make parallel.
Emit packages
zstd
bindings that are fast. Use--long
and tweak level (is -16 best?)zstd
compression, but support is early for that.Other ideas
boulder
DB. The main concern is running multiple builds. Provided we lock these so only one can handle pre-build phase at a time (when passing off to run the build stages, the next build can start). Only want the content, layout and metadata shared, and create a DB for anything else that's needed per buildboulder
separate for safety, but there's no reason you couldn't take the information from the host and reuse them (and reflink the files if supported). Could save some time and reduce the load on the servers and also copy fromboulder
to host asboulder
will have newer versions of the packages.The text was updated successfully, but these errors were encountered: