forked from slackhq/circuit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting up Macrobenchmarking and Baseline Profiles in Circuit (slackh…
…q#250) This PR setups a macrobenchmarking module to measure startup time with and without a baseline profile. Measured on a Pixel 6, API 33. **StartupBenchmark: Without Baseline Profile** StartupBenchmark_startup timeToInitialDisplayMs min 219.4, median 224.7, max 240.8 **StartupBenhmark: With Baseline Profile** StartupBenchmark_startup timeToInitialDisplayMs min 212.7, median 215.4, max 241.6 We are seeing about a 4% improvement with the min and median times. Zac mentioned that because this is a pretty basic app, the performance wins are not that apparent. Would be more apparent in a more complex app like Slack! Co-authored-by: Zac Sweers <[email protected]>
- Loading branch information
Showing
15 changed files
with
1,194 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
**/snapshots/**/*.png filter=lfs diff=lfs merge=lfs -text | ||
**/snapshots/**/*.png filter=lfs diff=lfs merge=lfs -text | ||
**/baseline-prof.txt linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Can't obfuscate when generating baseline profiles | ||
-dontobfuscate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright (C) 2022 Slack Technologies, LLC | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ https://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application | ||
android:label="Social Tees Animal Rescue" | ||
android:name="com.slack.circuit.star.StarApp" | ||
android:appComponentFactory="com.slack.circuit.star.di.StarAppComponentFactory" | ||
android:enableOnBackInvokedCallback="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="Social Tees Animal Rescue" | ||
android:theme="@style/StarTheme" | ||
android:enableOnBackInvokedCallback="true" | ||
android:appComponentFactory="com.slack.circuit.star.di.StarAppComponentFactory" | ||
tools:replace="android:appComponentFactory" /> | ||
tools:replace="android:appComponentFactory"> | ||
<profileable | ||
android:shell="true" | ||
tools:targetApi="29" /> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) 2022 Slack Technologies, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
plugins { | ||
id("com.android.test") | ||
kotlin("android") | ||
} | ||
|
||
android { | ||
namespace = "com.circuit.samples.star.benchmark" | ||
defaultConfig { | ||
targetSdk = 33 | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
// This benchmark buildType is used for benchmarking, and should function like your | ||
// release build (for example, with minification on). It"s signed with a debug key | ||
// for easy local/CI testing. | ||
create("benchmark") { | ||
isDebuggable = true | ||
signingConfig = getByName("debug").signingConfig | ||
matchingFallbacks += listOf("release") | ||
} | ||
} | ||
|
||
targetProjectPath = ":samples:star:apk" | ||
experimentalProperties["android.experimental.self-instrumenting"] = true | ||
} | ||
|
||
dependencies { | ||
implementation(libs.androidx.compose.runtime) | ||
implementation(libs.androidx.test.ext.junit) | ||
implementation(libs.androidx.test.espresso.core) | ||
implementation(libs.androidx.test.uiautomator) | ||
implementation(libs.androidx.benchmark.macro.junit) | ||
implementation(libs.androidx.profileinstaller) | ||
} | ||
|
||
androidComponents { beforeVariants { it.enable = it.buildType == "benchmark" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<queries> | ||
<package android:name="com.slack.circuit.sample.star.apk" /> | ||
</queries> | ||
</manifest> |
Oops, something went wrong.