← Back to context

Comment by manquer

3 hours ago

Can't comment on Bazel specifically, but having worked with both nx and turbo, the bottleneck was usually network and disk IOPS rarely compute.

Even fully cached outputs needs to fetched and read from a remote server[1]. A step n-1 outout fetched from remote cache server need to written to disk and then again read by step n[3] - all disk I/O and network bound operations.

10s may be achievable/realistic goal in the Java/C++ world where Bazel normally seen. In TS eco-system most people would be over the moon to get into ballpark of 1-2m for a decently large monorepo.

We should define Build more clearly here, if you mean running just transpile/compile steps or the full series of steps that includes tests (as the linear post here is talking about). It is hard to see even a small sub-set of a large suite of test that require a virtual DOM or a real browser can run in 10s or less.

[1] Typical for say managed CI setup .

[3] Common run-of-the-mill frontend + backend stacks in different languages etc.

If you don't need to rebuild anything, bazel can fetch only the final artifact (not the intermediates) from the remote cache.

Also, if you have persistent CI workers with a persistent bazel instance, you save on some network roundtrips, but that's obviously harder to set up and make bulletproof.

  • Typically you need the intermediates to compute if you need the next one , so you cannot skip to final until you have the intermediaries.

    The final asset/artifact is rarely small either. even best optimized artifacts can be few hundred MB docker image or more commonly multiple image layers running GBs in size .

    each step is a network pull then recompute cache if stale and keep going till end .

  • Bazel can even skip the final artefact!

    • well for test runs you kinda need the binary to run, but you're correct, if the job is just "does this build" no download necessary.