diff options
| author | Ulya Trafimovich <skvadrik@google.com> | 2022-06-30 13:21:35 +0100 |
|---|---|---|
| committer | Ulya Trafimovich <skvadrik@google.com> | 2022-07-07 12:12:50 +0100 |
| commit | 6fad1d0dbab163f63b09c1d7e15a60bd61c45913 (patch) | |
| tree | 6d094bb0d1d58c3662e1c546b870b21346644961 /dexpreopt | |
| parent | 40f9873612fe2b1ec122f0c147ae811ffa4d2574 (diff) | |
Dexpreopt: use "speed-profile" if a system server jar has a profile.
The motivation is to reduce file size and in-process memory footprint
for "services" (which is currently the only system server jar that has a
profile). For other system server jars that have no profile keep using
"speed", as enabling "speed-profile" for them would completely disable
AOT-compiled code.
Compare .odex file size:
- before: 44360 services.odex
- after: 24968 services.odex
Bug: b/237399630
Test: lunch aosp_sargo-userdebug && m
Change-Id: I844b9607c496d3d6e7048dc6bb8cd958ecbaa441
Diffstat (limited to 'dexpreopt')
| -rw-r--r-- | dexpreopt/dexpreopt.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index de139c439..d8011d69f 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -394,10 +394,14 @@ func dexpreoptCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, g if !android.PrefixInList(preoptFlags, "--compiler-filter=") { var compilerFilter string if systemServerJars.ContainsJar(module.Name) { - // Jars of system server, use the product option if it is set, speed otherwise. if global.SystemServerCompilerFilter != "" { + // Use the product option if it is set. compilerFilter = global.SystemServerCompilerFilter + } else if profile != nil { + // Use "speed-profile" for system server jars that have a profile. + compilerFilter = "speed-profile" } else { + // Use "speed" for system server jars that do not have a profile. compilerFilter = "speed" } } else if contains(global.SpeedApps, module.Name) || contains(global.SystemServerApps, module.Name) { |
