dev-cli
dev-cli copied to clipboard
decrease build times for pack command
We can reuse the tarball and append new files (node binaries in this case) instead of compressing/extracting multiple times. This prevents un-necessary copying of files in the built tarball.
We can also build all targets in parallel in the following way:
- Download Node.js versions for targets in parallel instead of serially
- Use workerpool to create gzip files in parallel
- Run all
xzcompression with maximum available threads. xz has supported multicore computation since 5.2 (2014). - Like gzip, run all
xzcompression in parallel instead of waiting for each target to build.
Running this in the Heroku CLI produced identical tarballs in 65% amount of time (~111s seconds vs ~344 seconds before this change). It's likely even a bit faster since I was running it locally which has some boot-up time due to ts-node compiling typescript at runtime.
This file brings in the tar dependency. This dependency is maintained by the npm team and is also cross-platform. This gets us quite a bit closer to allow building OClif CLIs on windows!