Status Update
Comments
cc...@google.com <cc...@google.com> #2
This also seems to apply to baseline-prof.txt
cc...@google.com <cc...@google.com> #3
We had this bug that was fixed in 8.3.0. I tested with AGP 8.4.0 and seems working fine.
I wasn't able to make your project work but I noticed
baselineProfile {
mergeIntoMain = true
baselineProfileOutputDir = "baselineProfiles" <---
}
Here you're changing the folder from src/<variant>/generated/baselineProfiles
to src/<variant>/baselineProfiles
(<variant>
here is main
since you enabled mergeIntoMain
).
As a result you need to either regenerate your profile or copy the old startup profile in the folder.
Also src/main/baselineProfiles
is the default for baseline profiles and always added to the baseline profiles src set, i.e. it's always evaluated.
Could you please try again that line? You should have your new startup profile generated in src/<variant>/generated/baselineProfiles/startup-prof.txt
. If you try to put a foo
line in it, you should have the error you mention.
I'm going ahead and marking as not reproducible but will re-open is you're still having issues.
cc...@google.com <cc...@google.com> #4
Note that I don't have baselineProfileOutputDir = "baselineProfiles"
in the branch I linked to reproduce this issue:
Adding baselineProfileOutputDir = "baselineProfiles"
(i.e. moving the profiles into src/main/baselineProfiles
like step 6 mentioned above) was my workaround to this issue, with this change AGP is able to pick up startup-prof.txt
.
ap...@google.com <ap...@google.com> #5
Sorry I think I made a mistake in step 4 and 7 (was confusing with
The original <flavor>Release
build (assembleProdRelease
) does pickup both profiles if they're placed under src/<variant>/generated/baselineProfiles
.
The <flavor>BenchmarkRelease
task generated by the baseline profile plugin however can't seem to be able to pickup files in src/<variant>/generated/baselineProfiles
, but src/<variant>/baselineProfiles
works.
So to reproduce it you can run ./gradlew assembleDevBenchmarkRelease
with the profiles in src/<variant>/generated/baselineProfiles
VS src/<variant>/baselineProfiles
, and compare app/build/intermediates
folder:
intermediates/merged_startup_profile/
is produced if the startup profile lives insrc/<variant>/baselineProfiles
- no
merged_startup_profile
folder is produced if the startup profile lives insrc/<variant>/generated/baselineProfiles
What this effectively means is without changing baselineProfileOutputDir
to point to src/<variant>/baselineProfiles
, the app being benchmarked won't include the profiles provided by the app which is how I found this issue (see
Description
Trivial hot startup test (
TrivialStartupBenchmark#startup[startup=WARM,compilation=None]
)Launch itself takes approx 45ms.
waitOnPackageLaunch() takes > 5.5 seconds. Of that, more than 4.5 seconds is spent waiting for the app to actually launch (that is, time elapsed before the
launching: <packagename>
trace section).It looks like the wait finishes several hundred millis later, due to UiAutomator polling every 1 second. The gap at the end of the trace is an intentional sleep, to ensure trace content isn't lost (400ms).