Bazel persistent workers
summary
Bazel shows 3x faster clean builds and up to 6x faster incremental builds by keeping long‑running worker processes that read work requests on stdin, write artifacts directly to disk, and return proto or JSON responses. Workers use flags like worker_max_instances=4 (default), per‑mnemonic limits, worker_sandboxing, and multiplexing to reduce JVM startup and memory overhead. Current gaps: multiplexing lacks full sandboxing, no request cancellation in the protocol, and Bazel cannot yet track per‑worker CPU/memory for scheduling.
AI-written summary · about
chapters (9)
- 0:00Persistent workers intro
- 1:27How workers improve build performance
- 3:11Worker multiplexing
- 4:59Tuning worker flags
- 8:12Worker binary creation
- 10:21Worker rules in Starlark
- 12:12Debugging workers
- 13:18Sandboxing and dynamic execution
- 17:36Future Bazel improvements








