3 ms·
Do you build on tmpfs? I started doing that and it makes builds ridiculously fast. $XDG_RUNTIME_DIR is perfect for this, I just make a directory there and symli
by matheusmoreira 6y ago
Do you build on tmpfs? I started doing that and it makes builds ridiculously fast. $XDG_RUNTIME_DIR is perfect for this, I just make a directory there and symlink the build directory to it. Even added some makefile logic to ensure the link target exists:
build_directory_link := $(shell readlink $(build_directory))
$(if $(build_directory_link),$(shell mkdir -p $(build_directory_link)))
- ed25519FUUU 6y agoGood optimization, thanks for the pointer!
- matheusmoreira 6y agoIt also reduces wear on storage devices. Why write temporary build artifacts to permanent memory after all? Gotta use those 32 GB of RAM for something. Linux will automatically cache all source files in RAM because of the page table cache. Writes to slow storage devices are eliminated through tmpfs. Amazing really.
- wyldfire 6y agoAlso, if you are using BFD ld, you should consider gold or lld. Significantly faster if the link is the slow step. Also much lower peak memory usage for lld, which is great if you have multiple concurrent link steps.