Benchmark compose sample apps
README.google:
Name: {Crane, JetCaster, JetChat, JetLagged, JetNews, JetSnack, Owl, Reply}
URL: https://github.com/android/compose-samples
Version: v2024.05.00
Revision: 06a7bf385c3cba50a991b3146b41bc5786b6598e
Date: May 2, 2024
License: Apache License 2.0
Change-Id: Ie11c2d51327eb6e867fa275f074545dfbb7420a5
diff --git a/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt b/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
index 25d24e38..06155f0 100644
--- a/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
+++ b/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
@@ -469,6 +469,70 @@
Paths.get(
"third_party", "opensource-apps", "compose-examples",
"changed-bitwise-value-propagation.tar.gz.sha1").toFile())
+ val composeSamplesCrane = ThirdPartyDependency(
+ "compose-samples-crane",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "crane").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "crane.tar.gz.sha1").toFile())
+ val composeSamplesJetCaster = ThirdPartyDependency(
+ "compose-samples-jetcaster",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetcaster").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetcaster.tar.gz.sha1").toFile())
+ val composeSamplesJetChat = ThirdPartyDependency(
+ "compose-samples-jetchat",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetchat").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetchat.tar.gz.sha1").toFile())
+ val composeSamplesJetLagged = ThirdPartyDependency(
+ "compose-samples-jetlagged",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetlagged").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetlagged.tar.gz.sha1").toFile())
+ val composeSamplesJetNews = ThirdPartyDependency(
+ "compose-samples-jetnews",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetnews").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetnews.tar.gz.sha1").toFile())
+ val composeSamplesJetSnack = ThirdPartyDependency(
+ "compose-samples-jetsnack",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetsnack").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "jetsnack.tar.gz.sha1").toFile())
+ val composeSamplesOwl = ThirdPartyDependency(
+ "compose-samples-owl",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "owl").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "owl.tar.gz.sha1").toFile())
+ val composeSamplesReply = ThirdPartyDependency(
+ "compose-samples-reply",
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "reply").toFile(),
+ Paths.get(
+ "third_party", "opensource-apps", "android", "compose-samples",
+ "reply.tar.gz.sha1").toFile())
val coreLambdaStubs = ThirdPartyDependency(
"coreLambdaStubs",
Paths.get("third_party", "core-lambda-stubs").toFile(),
diff --git a/src/test/java/com/android/tools/r8/benchmarks/BenchmarkCollection.java b/src/test/java/com/android/tools/r8/benchmarks/BenchmarkCollection.java
index f7c60a4..e265bf9 100644
--- a/src/test/java/com/android/tools/r8/benchmarks/BenchmarkCollection.java
+++ b/src/test/java/com/android/tools/r8/benchmarks/BenchmarkCollection.java
@@ -5,6 +5,7 @@
import static java.util.Collections.emptyList;
+import com.android.tools.r8.benchmarks.appdumps.ComposeSamplesBenchmarks;
import com.android.tools.r8.benchmarks.appdumps.NowInAndroidBenchmarks;
import com.android.tools.r8.benchmarks.appdumps.TiviBenchmarks;
import com.android.tools.r8.benchmarks.desugaredlib.L8Benchmark;
@@ -24,6 +25,13 @@
// Actual list of all configured benchmarks.
private final Map<String, List<BenchmarkConfig>> benchmarks = new HashMap<>();
+ @SafeVarargs
+ public BenchmarkCollection(List<BenchmarkConfig>... benchmarksCollection) {
+ for (List<BenchmarkConfig> benchmarks : benchmarksCollection) {
+ benchmarks.forEach(this::addBenchmark);
+ }
+ }
+
private void addBenchmark(BenchmarkConfig benchmark) {
List<BenchmarkConfig> variants =
benchmarks.computeIfAbsent(benchmark.getName(), k -> new ArrayList<>());
@@ -52,15 +60,15 @@
}
public static BenchmarkCollection computeCollection() {
- BenchmarkCollection collection = new BenchmarkCollection();
// Every benchmark that should be active on golem must be setup in this method.
- HelloWorldBenchmark.configs().forEach(collection::addBenchmark);
- LegacyDesugaredLibraryBenchmark.configs().forEach(collection::addBenchmark);
- L8Benchmark.configs().forEach(collection::addBenchmark);
- NowInAndroidBenchmarks.configs().forEach(collection::addBenchmark);
- TiviBenchmarks.configs().forEach(collection::addBenchmark);
- RetraceStackTraceBenchmark.configs().forEach(collection::addBenchmark);
- return collection;
+ return new BenchmarkCollection(
+ HelloWorldBenchmark.configs(),
+ LegacyDesugaredLibraryBenchmark.configs(),
+ L8Benchmark.configs(),
+ NowInAndroidBenchmarks.configs(),
+ TiviBenchmarks.configs(),
+ RetraceStackTraceBenchmark.configs(),
+ ComposeSamplesBenchmarks.configs());
}
/** Compute and print the golem configuration. */
diff --git a/src/test/java/com/android/tools/r8/benchmarks/appdumps/ComposeSamplesBenchmarks.java b/src/test/java/com/android/tools/r8/benchmarks/appdumps/ComposeSamplesBenchmarks.java
new file mode 100644
index 0000000..fe5a612
--- /dev/null
+++ b/src/test/java/com/android/tools/r8/benchmarks/appdumps/ComposeSamplesBenchmarks.java
@@ -0,0 +1,76 @@
+// Copyright (c) 2024, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+package com.android.tools.r8.benchmarks.appdumps;
+
+import com.android.tools.r8.TestParameters;
+import com.android.tools.r8.ToolHelper;
+import com.android.tools.r8.benchmarks.BenchmarkBase;
+import com.android.tools.r8.benchmarks.BenchmarkConfig;
+import com.google.common.collect.ImmutableList;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+@RunWith(Parameterized.class)
+public class ComposeSamplesBenchmarks extends BenchmarkBase {
+
+ private static final Path dir =
+ Paths.get(ToolHelper.THIRD_PARTY_DIR, "opensource-apps/android/compose-samples");
+
+ public ComposeSamplesBenchmarks(BenchmarkConfig config, TestParameters parameters) {
+ super(config, parameters);
+ }
+
+ @Parameters(name = "{0}")
+ public static List<Object[]> data() {
+ return parametersFromConfigs(configs());
+ }
+
+ public static List<BenchmarkConfig> configs() {
+ return ImmutableList.of(
+ AppDumpBenchmarkBuilder.builder()
+ .setName("CraneApp")
+ .setDumpDependencyPath(dir.resolve("crane"))
+ .setFromRevision(16457)
+ .buildR8(),
+ AppDumpBenchmarkBuilder.builder()
+ .setName("JetLaggedApp")
+ .setDumpDependencyPath(dir.resolve("jetlagged"))
+ .setFromRevision(16457)
+ .buildR8(),
+ AppDumpBenchmarkBuilder.builder()
+ .setName("JetNewsApp")
+ .setDumpDependencyPath(dir.resolve("jetnews"))
+ .setFromRevision(16457)
+ .buildR8(),
+ AppDumpBenchmarkBuilder.builder()
+ .setName("JetCasterApp")
+ .setDumpDependencyPath(dir.resolve("jetcaster"))
+ .setFromRevision(16457)
+ .buildR8(),
+ AppDumpBenchmarkBuilder.builder()
+ .setName("JetChatApp")
+ .setDumpDependencyPath(dir.resolve("jetchat"))
+ .setFromRevision(16457)
+ .buildR8(),
+ AppDumpBenchmarkBuilder.builder()
+ .setName("JetSnackApp")
+ .setDumpDependencyPath(dir.resolve("jetsnack"))
+ .setFromRevision(16457)
+ .buildR8(),
+ AppDumpBenchmarkBuilder.builder()
+ .setName("OwlApp")
+ .setDumpDependencyPath(dir.resolve("owl"))
+ .setFromRevision(16457)
+ .buildR8(),
+ AppDumpBenchmarkBuilder.builder()
+ .setName("ReplyApp")
+ .setDumpDependencyPath(dir.resolve("reply"))
+ .setFromRevision(16457)
+ .buildR8());
+ }
+}
diff --git a/third_party/opensource-apps/android/compose-samples/crane.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/crane.tar.gz.sha1
index 43b6ec0..8151eb0 100644
--- a/third_party/opensource-apps/android/compose-samples/crane.tar.gz.sha1
+++ b/third_party/opensource-apps/android/compose-samples/crane.tar.gz.sha1
@@ -1 +1 @@
-54e1cfb2bd83e005ccd07179958261d5ed2c7102
\ No newline at end of file
+d8cd1490244b1dc97d889b9fabec76d08cef7c0e
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/jetcaster.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/jetcaster.tar.gz.sha1
index e4fdd09..a850e28 100644
--- a/third_party/opensource-apps/android/compose-samples/jetcaster.tar.gz.sha1
+++ b/third_party/opensource-apps/android/compose-samples/jetcaster.tar.gz.sha1
@@ -1 +1 @@
-158d1e78d2055793960120b1c58654f83cd6d4d3
\ No newline at end of file
+0604c1cbdefc095b510e057720432024ea359dbc
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/jetchat.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/jetchat.tar.gz.sha1
index 5e613de..94883e7 100644
--- a/third_party/opensource-apps/android/compose-samples/jetchat.tar.gz.sha1
+++ b/third_party/opensource-apps/android/compose-samples/jetchat.tar.gz.sha1
@@ -1 +1 @@
-0a6e35687efada2890624783e9936047ed10b434
\ No newline at end of file
+49259c45a5fedfd6eaf89c776a84a5398cf27384
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/jetlagged.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/jetlagged.tar.gz.sha1
new file mode 100644
index 0000000..1bf9ac9
--- /dev/null
+++ b/third_party/opensource-apps/android/compose-samples/jetlagged.tar.gz.sha1
@@ -0,0 +1 @@
+c649ac9267753c0e1451b3954d210b8657516660
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/jetnews.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/jetnews.tar.gz.sha1
index 3fb24df..6574b20 100644
--- a/third_party/opensource-apps/android/compose-samples/jetnews.tar.gz.sha1
+++ b/third_party/opensource-apps/android/compose-samples/jetnews.tar.gz.sha1
@@ -1 +1 @@
-d1c89d1a22c716d3c9e2c8b7b725bc4716d12ea6
\ No newline at end of file
+0c8d2ca9a1cf572072830a8de6b5226b43ce74e7
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/jetsnack.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/jetsnack.tar.gz.sha1
index 9562d67..c82ebde 100644
--- a/third_party/opensource-apps/android/compose-samples/jetsnack.tar.gz.sha1
+++ b/third_party/opensource-apps/android/compose-samples/jetsnack.tar.gz.sha1
@@ -1 +1 @@
-2e7d404796f7c4b20f47957fef00755665623526
\ No newline at end of file
+11905a3eb956d99d89259ca84b0e0c47f651dd39
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/jetsurvey.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/jetsurvey.tar.gz.sha1
deleted file mode 100644
index 736edd4..0000000
--- a/third_party/opensource-apps/android/compose-samples/jetsurvey.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0dc41fbe14dbfb3bfc70ed64ff129b311bfcbf94
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/owl.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/owl.tar.gz.sha1
index d6c218c..86fdccf 100644
--- a/third_party/opensource-apps/android/compose-samples/owl.tar.gz.sha1
+++ b/third_party/opensource-apps/android/compose-samples/owl.tar.gz.sha1
@@ -1 +1 @@
-9bb9c1cc3fea6d4ceb33df8e99057caa1bbe94f6
\ No newline at end of file
+be9dbb7f37c872d619ad3a89cbfa6fb4a93cc9fb
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/rally.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/rally.tar.gz.sha1
deleted file mode 100644
index 3947935..0000000
--- a/third_party/opensource-apps/android/compose-samples/rally.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-86f3577a407a3cc3883f2d016d23879f3e8bd64e
\ No newline at end of file
diff --git a/third_party/opensource-apps/android/compose-samples/reply.tar.gz.sha1 b/third_party/opensource-apps/android/compose-samples/reply.tar.gz.sha1
new file mode 100644
index 0000000..120bf4c
--- /dev/null
+++ b/third_party/opensource-apps/android/compose-samples/reply.tar.gz.sha1
@@ -0,0 +1 @@
+343b9b35f15e8d5952514f91b9934f9e925aa880
\ No newline at end of file
diff --git a/tools/perf.py b/tools/perf.py
index 0186435..de0635a 100755
--- a/tools/perf.py
+++ b/tools/perf.py
@@ -24,12 +24,10 @@
}
# Result structure on cloud storage
-# gs://bucket/benchmark_results/APP/TARGET/GIT_HASH/results
+# gs://bucket/benchmark_results/APP/TARGET/GIT_HASH/result.json
# meta
# where results simply contains the result lines and
# meta contains information about the execution (machine)
-
-
def ParseOptions():
result = argparse.ArgumentParser()
result.add_argument('--app',
@@ -62,7 +60,7 @@
help='Use R8 hash for the run (default local build)',
default=None)
options, args = result.parse_known_args()
- options.apps = options.app or ['NowInAndroidApp', 'TiviApp']
+ options.apps = options.app or ['CraneApp', 'JetLaggedApp', 'JetNewsApp', 'JetCasterApp', 'JetChatApp', 'JetSnackApp', 'NowInAndroidApp', 'Owl', 'ReplyApp', 'TiviApp']
options.quiet = not options.verbose
del options.app
return options, args
diff --git a/tools/run_on_app_dump.py b/tools/run_on_app_dump.py
index bf50da3..d6226be 100755
--- a/tools/run_on_app_dump.py
+++ b/tools/run_on_app_dump.py
@@ -386,101 +386,10 @@
'url': 'https://github.com/wikimedia/apps-android-wikipedia',
'revision': '0fa7cad843c66313be8e25790ef084cf1a1fa67e',
'folder': 'wikipedia',
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'androidx.compose.samples.crane',
- 'name': 'compose-crane',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/crane',
- 'golem_duration': 240
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'com.example.jetcaster',
- 'name': 'compose-jetcaster',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/jetcaster',
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'com.example.compose.jetchat',
- 'name': 'compose-jetchat',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/jetchat',
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'com.example.jetnews',
- 'name': 'compose-jetnews',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/jetnews',
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'com.example.jetsnack',
- 'name': 'compose-jetsnack',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/jetsnack',
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'com.example.compose.jetsurvey',
- 'name': 'compose-jetsurvey',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/jetsurvey',
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'com.example.owl',
- 'name': 'compose-owl',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/owl',
- }),
- # TODO(b/173167253): Check if monkey testing works.
- App({
- 'id': 'com.example.compose.rally',
- 'name': 'compose-rally',
- 'collections': ['compose-samples'],
- 'dump_app': 'dump_app.zip',
- 'apk_app': 'app-release-unsigned.apk',
- 'url': 'https://github.com/android/compose-samples',
- 'revision': '779cf9e187b8ee2c6b620b2abb4524719b3f10f8',
- 'folder': 'android/compose-samples/rally',
- }),
+ })
]
-APP_COLLECTIONS = [AppCollection({
- 'name': 'compose-samples',
-})]
+APP_COLLECTIONS = []
def remove_print_lines(file):