简体   繁体   中英

Baseline Profiles x R8/Proguard

I've been experimenting with Android's Baseline Profile & MacroBenchmark libraries for improving the app performance.

The question I have is that it is suggested that the MacroBenchmark's build-types be as close to the release build but with -dontobfuscate in the proguard rules.
If the production app is going to be obfuscated via minification then how can Baseline Profiler help in app performance as the classes could be completely different in baseline-prof.txt & in the app's classes.dex file.

Is there some sort of mapping happening internally between Profiler & Proguard/R8?

I edited this after consulting with the Baseline Profule team.

The support for Baseline Profiles will do a "best effort" mapping of the baseline profile from the input program to the R8 generated app using the R8 mapping file. As the mapping file generated by R8 is only designed to be able to map from the generated app back to the orignial app, so mapping the other way is not complete. The "best effort" usually will work quite well, but might not be complete.

I asked the same question on the Google Issue Tracker & was told that the Baseline Profile also participates in the obfuscation process & the classes/methods recorded by the benchmark are refactored with the new obfuscated ones during the obfuscation.

Source: Check comment#2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM