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.
Remove static RequestKinds cache and improve build performance.
See #1645 The static RequestKinds cache causes a memory leak in gradle due to the persistent GradleDaemon. This CL removes that cache entirely, and instead fixes the root causes of the performance issues, by short circuiting InjectionSiteVisitor to abort early if the method is not injectable. This avoids a lot of unnecessary calls to RequestKinds.getRequestKind() for methods that are not injectable (e.g. aren't annotated with @Inject). The aggregated pprof results from 10 runs before and after changes in this CL are below. Before (s) After (s) Diff ----------------------------------------------------------------------------- ComponentProcessingStep.process 51.80 43.25 -16.5% RequestKinds.getRequestKind 8.48 0.33 -95.9% ----------------------------------------------------------------------------- RELNOTES=Fix memory leak with RequestKinds cache. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=286934462
- Loading branch information
Showing
2 changed files
with
49 additions
and
86 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