Skip to content

Commit

Permalink
Only setup mock data once for baseline profiles and benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
clark-signal authored and greyson-signal committed Mar 20, 2023
1 parent e1e117c commit ed2d6ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ class BaselineProfileGenerator {
fun startup() = baselineProfileRule.collectBaselineProfile(
packageName = "org.thoughtcrime.securesms",
profileBlock = {
val setupIntent = Intent().apply {
component = ComponentName("org.thoughtcrime.securesms", "org.signal.benchmark.BenchmarkSetupActivity")
if (iteration == 0) {
val setupIntent = Intent().apply {
component = ComponentName("org.thoughtcrime.securesms", "org.signal.benchmark.BenchmarkSetupActivity")
}
startActivityAndWait(setupIntent)
}
startActivityAndWait(setupIntent)
startActivityAndWait()
device.findObject(By.textContains("Buddy")).click();
device.wait(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ class StartupBenchmarks {
iterations = iterations,
startupMode = StartupMode.COLD,
compilationMode = compilationMode,
setupBlock = fakeDataSetupBlock
setupBlock = {
if (compilationMode !is CompilationMode.Partial || iteration == 0) {
fakeDataSetupBlock()
}
}
) {
pressHome()
startActivityAndWait()
Expand Down

0 comments on commit ed2d6ea

Please sign in to comment.