Measure and improve Bazel build performance.

Start with the layer that dominates elapsed time, then use build-level evidence to verify that each change improves developer and CI outcomes.

Capture the build that is actually slow

Record the target, commit, Bazel version, flags, platform, and whether the runner is new or warm. Compare the same workload. A first build, an unchanged rerun, and a build after a source edit measure different behavior.

Replace the target below with your own and keep your team's normal build configuration. Save the profile and Build Event Protocol (BEP) file before changing flags or capacity.

bazel build //your/package:target \
  --profile=/tmp/slow-build.profile.gz \
  --build_event_json_file=/tmp/slow-build.bep.json

Open the profile using a viewer supported by the Bazel JSON trace profile documentation. BEP provides outcomes and build metadata; it does not replace the profile or remote-action records.

Find the phase before choosing a fix

Where time goesCheck firstNext investigation
Loading or analysisDependency resolution, rule work, graph size, and whether the Bazel server or analysis cache was lost.Compare a warm run with equivalent flags. A remote action cache does not eliminate analysis.
Unexpected action executionChanges to inputs, tools, commands, environment, platform, and cache policy.Investigate cache misses.
A long dependency chainThe critical path and whether its actions can overlap.Inspect the expensive targets and dependencies. More workers cannot parallelize a serial chain by themselves.
Remote queueingCompatible workers, platform properties, capacity, and concurrent demand.Diagnose the platform queue.
Transfers or cache requestsInput and output size, request latency, network, and storage behavior.Use connected remote-action and infrastructure records to locate the delay.
Tests and retriesThe slow test's log, timeout, attempts, shards, and execution environment.Separate test flakiness from infrastructure failure.

Time spent waiting for a worker and time spent executing are different constraints. So are a cache hit count and time saved. Inspect the affected actions; an overall percentage can hide the expensive work.

Make one change and compare equivalent runs

Follow the dominant phase. Correct an unintended input change before resizing the cache. Check worker eligibility before adding workers. Investigate analysis-cache invalidation before assuming execution is the bottleneck.

Keep source, configuration, platform, and local state comparable, apart from the change under test. Save a second profile and BEP file with different filenames. Repeat enough to see normal variation, and report elapsed time with the workload and conditions attached.

Avoid clearing Bazel's state as a routine performance fix. It changes the workload you are measuring and can discard useful incremental state. For a deliberately cold comparison, use an isolated output base and describe it as cold.

Validate the outputs and relevant tests as well as timing. A skipped test, a cache-policy change, or less work requested can make a command finish sooner without improving the same build.

Connect the profile to build history

Hermetiq can compare recorded builds and use uploaded profiles to investigate performance. Queue and worker questions need corresponding remote-action or infrastructure sources. Build Analytics & AI works with existing Bazel infrastructure; Managed Cache & Execution is the option for an agreed infrastructure handoff.

References: Bazel iteration speed and analysis state, JSON trace profiles, and remote-execution requirements. Reviewed November 19, 2026.

Investigate your own build data.

Hermetiq connects Bazel and Buildbarn telemetry to the answers your engineers and AI agents need. See which data sources power the analysis.

Explore Hermetiq for Bazel →

Technical review: November 19, 2026 · Verify flags, metric availability, and behavior against the versions deployed in your environment.