Skip to content

Speedup collect_deps#3634

Merged
illicitonion merged 1 commit intobazelbuild:mainfrom
hermeticbuild:zbarsky/collect-deps
Sep 29, 2025
Merged

Speedup collect_deps#3634
illicitonion merged 1 commit intobazelbuild:mainfrom
hermeticbuild:zbarsky/collect-deps

Conversation

@dzbarsky
Copy link
Contributor

The key insight is that deps and proc_macro_deps must be disjoint, so the depset.to_list is not doing any deduping. With that out of the way, we do a bit of code rearranging to avoid converting our lists of deps to depsets too early; in general it is best to construct the output depsets when creating the providers, not in the middle of the rule implementations.

Before:
image

After:
image

@dzbarsky dzbarsky force-pushed the zbarsky/collect-deps branch from 8b363d4 to 104a501 Compare September 29, 2025 17:55
Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little surprising how many .to_list() calls we're adding here, but I guess these were all just hidden inside collect_deps, so it'll be easier for us to remove these in the future if we want to try to, than it was before! Thank you!

@illicitonion illicitonion added this pull request to the merge queue Sep 29, 2025
@dzbarsky
Copy link
Contributor Author

It's a little surprising how many .to_list() calls we're adding here, but I guess these were all just hidden inside collect_deps, so it'll be easier for us to remove these in the future if we want to try to, than it was before! Thank you!

Exactly. These are all terminal nodes also whereas before we would call to_list on lib to lib edges.

Merged via the queue into bazelbuild:main with commit 98e494e Sep 29, 2025
3 checks passed
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 7, 2025
…_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 815679316
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 8, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 815679316
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 13, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 815679316
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 14, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 815679316
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 15, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 815679316
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 16, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 815679316
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 20, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 815679316
copybara-service bot pushed a commit to google/crubit that referenced this pull request Oct 21, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 822050008
Change-Id: I73c6feb0335651979c7b4ca637623385e9010704
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 21, 2025
bazelbuild/rules_rust#3634, which updates the deps and proc_macro_deps of rustc_compile_action and collect_deps to list.

PiperOrigin-RevId: 822050008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants