12

Everytime after a build is done, I see something like:

Elapsed time: 1034.748s, Critical Path: 257.54s

Wondering what's the difference between Elapsed Time and Critical Path? What can be causing the time difference?

Forwarded from: https://github.com/bazelbuild/bazel/issues/3164

Yun Peng
  • 353
  • 1
  • 7

1 Answers1

13

"Elapsed time" shows the wall time of the build, since Bazel started running the first build action until the last action finished.

"Critical path" shows the wall time spent building the longest chain of actions, where each subsequent action depends on the output(s) of the previous one, so they must be run sequentially. The critical path is a lower limit on the clean build time of this build; even if the CPU had more cores than the number of actions Bazel ever runs in parallel, the build could still not complete any faster.

The time difference is caused by Bazel executing other actions too. There were presumably more actions to run than just those on the critical path.

László
  • 3,973
  • 1
  • 13
  • 26