bazelbuild / bazelbuild/bazel

rdeps clauses in query are not executed in parallel

Open
#21,731 7 comments 0 reactions 0 assignees View on GitHub
not stale team-Performance type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

I would like to be able to perform multiple `bazel query` operations in parallel without using a different `output_base`.

### Which category does this issue belong to?

Performance

### What underlying problem are you trying to solve with this feature?

I need to query for `rdeps` but I need to exclude references to the package itself. Therefore I am using the following query:
```
rdeps( //..., //foo, 1) except //foo/...
```

I do have *N* number of packages. Thus, I need to run this query N times. It would be great if I can do this in parallel.

I also did try with a combined query:
```
(rdeps( //..., //foo, 1) except //foo/...)
+
(rdeps( //..., //bar, 1) except //bar/...)
+
..
```

However, that does not seem to trigger any performance optimization within Bazel, i.e. all `(rdeps ...)` clauses seems to be executed sequentially one by another.

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

macOS 14.4

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

7.0.1

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two query forms with bazel query: repeated rdeps(... ) except ... operations and the combined expression using +. Measure whether the rdeps clauses run sequentially, then investigate the query execution path. Done means independent queries can run in parallel without using different output_base, with performance evidence.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.