Optimize mutator contexts
Mutator contexts are created for every module, and in the case of transition mutator contexts for every dependency of every module. Unlike the Blueprint mutator contexts that they wrap, the Soong mutator contexts can be relatively large. Add global pools for all of them that can avoid the repeated allocations. Test: SOONG_PROFILE_MEM=/tmp/mem.pprof m nothing Change-Id: I64a5f3c91292cff6352300f99c11ac50c713f96d
This commit is contained in:
@@ -426,6 +426,7 @@ func osMutator(bpctx blueprint.BottomUpMutatorContext) {
|
||||
// filters out non-Soong modules. Now that we've handled them, create a
|
||||
// normal android.BottomUpMutatorContext.
|
||||
mctx := bottomUpMutatorContextFactory(bpctx, module, false)
|
||||
defer bottomUpMutatorContextPool.Put(mctx)
|
||||
|
||||
base := module.base()
|
||||
|
||||
@@ -572,6 +573,7 @@ func archMutator(bpctx blueprint.BottomUpMutatorContext) {
|
||||
// filters out non-Soong modules. Now that we've handled them, create a
|
||||
// normal android.BottomUpMutatorContext.
|
||||
mctx := bottomUpMutatorContextFactory(bpctx, module, false)
|
||||
defer bottomUpMutatorContextPool.Put(mctx)
|
||||
|
||||
base := module.base()
|
||||
|
||||
|
Reference in New Issue
Block a user