mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Split performance benchmark and baseline profile into separate modules.
This commit is contained in:
committed by
Greyson Parrelli
parent
3dd5ad2a8a
commit
4a39c7950f
@@ -1,39 +0,0 @@
|
||||
package org.thoughtcrime.benchmark
|
||||
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.benchmark.macro.junit4.BaselineProfileRule
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* WARNING! THIS WILL WIPE YOUR SIGNAL INSTALL
|
||||
*
|
||||
* Test that generates a Baseline profile from a user journey. Our journey is:
|
||||
* - start the app
|
||||
* - open a conversation
|
||||
*/
|
||||
@RequiresApi(28)
|
||||
class BaselineProfileGenerator {
|
||||
@get:Rule
|
||||
val baselineProfileRule = BaselineProfileRule()
|
||||
|
||||
@Test
|
||||
fun startup() {
|
||||
var setup = false
|
||||
baselineProfileRule.collect(
|
||||
packageName = "org.thoughtcrime.securesms",
|
||||
profileBlock = {
|
||||
if (!setup) {
|
||||
BenchmarkSetup.setup("cold-start", device)
|
||||
setup = true
|
||||
}
|
||||
startActivityAndWait()
|
||||
device.findObject(By.textContains("Buddy")).click();
|
||||
device.wait(Until.hasObject(By.textContains("Signal message")), 10_000L)
|
||||
device.wait(Until.hasObject(By.textContains("Test")), 5_000L)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -9,4 +9,4 @@ object BenchmarkSetup {
|
||||
device.executeShellCommand("am start -W -n org.thoughtcrime.securesms/org.signal.benchmark.BenchmarkSetupActivity --es setup-type $type")
|
||||
device.wait(Until.hasObject(By.textContains("done")), 25_000L)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.thoughtcrime.benchmark
|
||||
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.benchmark.macro.BaselineProfileMode
|
||||
import androidx.benchmark.macro.CompilationMode
|
||||
import androidx.benchmark.macro.ExperimentalMetricApi
|
||||
import androidx.benchmark.macro.StartupMode
|
||||
@@ -30,7 +31,7 @@ class StartupBenchmarks {
|
||||
|
||||
@Test
|
||||
fun coldStartBaselineProfile() {
|
||||
measureStartup(5, CompilationMode.Partial())
|
||||
measureStartup(5, CompilationMode.Partial(BaselineProfileMode.Require))
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMetricApi::class)
|
||||
|
||||
Reference in New Issue
Block a user