forked from square/dagger
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dagger Optimization]: Avoid copying bindings for each parent compone…
…nt when creating our `BindingGraph`. This CL replaces `LegacyBindingGraph` with a new class `BindingGraphFactory.LegacyBindingGraph` which is nested in `BindingGraphFactory` so that it can delegate directly to its `BindingGraphFactory.Resolver`. This allows us to just reuse the resolver under the hood and to implement it in a way that avoids copying all parent bindings into a giant `Map<Key, ResolvedBindings>`. Instead, the resolver can first look up in its own `resolvedContributionBindings` map and just delegate to its parent if the key doesn't exist. This can save quite a bit of resources for cases where a project has many small subcomponents branched from a larger component since each small subcomponent doesn't have to copy over all of the bindings from the larger component into its own `Map<Key, ResolvedBindings>`. Note: This is a similar optimization to CL/578306878. RELNOTES=N/A PiperOrigin-RevId: 583124976
- Loading branch information
Showing
3 changed files
with
76 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 0 additions & 94 deletions
94
java/dagger/internal/codegen/binding/LegacyBindingGraph.java
This file was deleted.
Oops, something went wrong.