EngFlow / bazel_invocation_analyzer

A tool that automatically analyzes a Bazel build's profile and offers suggestions on how to make it faster.
https://analyzer.engflow.com
Apache License 2.0
90 stars 10 forks source link

Recommend reducing runfiles tree creation #107

Open ulfjack opened 1 year ago

ulfjack commented 1 year ago

Problem

We have a build that is slow due to excessive local runfiles tree creation, while most actions are cached (or executed) remotely and do not need a runfiles tree. Enabling --nobuild_runfiles_links can reduce the time of such builds by a factor of 2 or more.

I attached before/after screenshots that show the effect of setting this flag. In this build, we still see an excessive amount of "acquiring semaphore" operations locally, but at least it is significantly faster.

Before

excessive-runfiles-before-2023-03-24

After

excessive-runfiles-after-2023-03-24

ulfjack commented 1 year ago

Posting two internal invocation ids as a reminder if we need more details:

ulfjack commented 1 year ago

Also see https://github.com/bazelbuild/bazel/issues/6627 for more details on runfiles trees.