bazelbuild / bazelbuild/bazel

Improve "action.prepare" performance

Open
#19,266 8 comments 0 reactions 0 assignees View on GitHub
P2 team-Performance type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the bug:

action.prepare step - 4.4 seconds
ActionContinuation.execute - 10.4 seconds

Since all of this is in critical path where every second savings matter, we would like to explore if there are opportunities for improving the performance of the `action.prepare step`.

From the [documentation here](https://github.com/bazelbuild/bazel/blob/0ffba8189364dc86f4ee31f3b6be5e3ebd5d09d7/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java#L1016),
```
// This call generally deletes any files at locations that are declared outputs of the
// action, although some actions perform additional work, while others intentionally
// keep previous outputs in place.
```
Screenshot 2023-08-16 at 4 27 23 PM

### Which category does this issue belong to?

Performance

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

_No response_

### Which operating system are you running Bazel on?

macOS

### What is the output of `bazel info release`?

Bazel 6.4 https://github.com/bazelbuild/bazel/commit/e34112fc93f34b0e40d3bdcc72f0f8f52b641ec3

Contributor guide

Open the contributing guide

Research direction

Start with SkyframeActionExecutor.java at the documented call near line 1016, then trace the action.prepare step and ActionContinuation.execute timings described in the issue. Establish a reproducible macOS Bazel 6.4 measurement and identify whether action.prepare can be shortened; done means demonstrating a measured reduction in its critical-path time.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.