-
Notifications
You must be signed in to change notification settings - Fork 111
Added some basic microbenchmarks for the workflow runtime. #1448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
37 changes: 37 additions & 0 deletions
37
benchmarks/runtime-microbenchmark/benchmark-proguard-rules.pro
This file contains hidden or 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,37 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # You can control the set of applied configuration files using the | ||
| # proguardFiles setting in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Uncomment this to preserve the line number information for | ||
| # debugging stack traces. | ||
| #-keepattributes SourceFile,LineNumberTable | ||
|
|
||
| # If you keep the line number information, uncomment this to | ||
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile | ||
|
|
||
| -dontobfuscate | ||
|
|
||
| -ignorewarnings | ||
|
|
||
| -keepattributes *Annotation* | ||
|
|
||
| -dontnote junit.framework.** | ||
| -dontnote junit.runner.** | ||
|
|
||
| -dontwarn androidx.test.** | ||
| -dontwarn org.junit.** | ||
| -dontwarn org.hamcrest.** | ||
| -dontwarn com.squareup.javawriter.JavaWriter | ||
|
|
||
| -keepclasseswithmembers @org.junit.runner.RunWith public class * |
This file contains hidden or 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,77 @@ | ||
| import com.rickbusarow.kgx.libsCatalog | ||
| import com.rickbusarow.kgx.version | ||
| import com.squareup.workflow1.buildsrc.internal.javaTarget | ||
| import com.squareup.workflow1.buildsrc.internal.javaTargetVersion | ||
|
|
||
| plugins { | ||
| // Must be applied before kotlin-android so the convention can detect that this is a benchmark. | ||
| alias(libs.plugins.androidx.benchmark) | ||
| id("com.android.library") | ||
| id("kotlin-android") | ||
| id("app.cash.burst") | ||
| } | ||
|
|
||
| // Note: We are not including our defaults from .buildscript as we do not need the base Workflow | ||
| // dependencies that those include. | ||
|
|
||
| android { | ||
| compileSdk = libsCatalog.version("compileSdk").toInt() | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility = javaTargetVersion | ||
| targetCompatibility = javaTargetVersion | ||
| } | ||
|
|
||
| kotlinOptions { | ||
| jvmTarget = javaTarget | ||
| freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" | ||
| } | ||
|
|
||
| defaultConfig { | ||
| minSdk = 28 | ||
| targetSdk = libsCatalog.version("targetSdk").toInt() | ||
|
|
||
| testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner" | ||
|
|
||
| // This flag is supposed to enable dry run in the test runner, and it does so locally, but for | ||
| // some reason it doesn't seem to be working in CI. | ||
|
zach-klippenstein marked this conversation as resolved.
|
||
| val benchmarkDryRunEnabled = project.findProperty("androidx.benchmark.dryRunMode.enable") | ||
| if (benchmarkDryRunEnabled == "true") { | ||
| println("Running benchmarks in dry mode: emulator allowed, no measurements taken, no warmup.") | ||
| testInstrumentationRunnerArguments["androidx.benchmark.dryRunMode.enable"] = "true" | ||
| } else { | ||
| // must be one of: 'None', 'StackSampling', or 'MethodTracing' | ||
| testInstrumentationRunnerArguments["androidx.benchmark.profiling.mode"] = "MethodTracing" | ||
| testInstrumentationRunnerArguments["androidx.benchmark.output.enable"] = "true" | ||
| } | ||
| } | ||
|
|
||
| testBuildType = "release" | ||
| buildTypes { | ||
| debug { | ||
| // Since isDebuggable can"t be modified by gradle for library modules, | ||
| // it must be done in a manifest - see src/androidTest/AndroidManifest.xml | ||
| isMinifyEnabled = true | ||
| proguardFiles( | ||
| getDefaultProguardFile("proguard-android-optimize.txt"), | ||
| "benchmark-proguard-rules.pro" | ||
| ) | ||
| } | ||
| release { | ||
| isDefault = true | ||
| } | ||
| } | ||
|
|
||
| namespace = "com.squareup.benchmark.runtime.benchmark" | ||
| testNamespace = "$namespace.test" | ||
| } | ||
|
|
||
| dependencies { | ||
| androidTestImplementation(project(":workflow-runtime")) | ||
| androidTestImplementation(libs.androidx.benchmark) | ||
| androidTestImplementation(libs.androidx.test.espresso.core) | ||
| androidTestImplementation(libs.androidx.test.junit) | ||
| androidTestImplementation(libs.androidx.test.uiautomator) | ||
| androidTestImplementation(libs.kotlin.test.jdk) | ||
| androidTestImplementation(libs.kotlinx.coroutines.test) | ||
| } | ||
17 changes: 17 additions & 0 deletions
17
benchmarks/runtime-microbenchmark/src/androidTest/AndroidManifest.xml
This file contains hidden or 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,17 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| xmlns:tools="http://schemas.android.com/tools"> | ||
|
|
||
| <!-- | ||
| Important: disable debugging for accurate performance results | ||
|
|
||
| In a com.android.library project, this flag must be disabled from this | ||
| manifest, as it is not possible to override this flag from Gradle. | ||
| --> | ||
| <application | ||
| android:debuggable="false" | ||
| tools:ignore="HardcodedDebugMode" | ||
| tools:replace="android:debuggable"> | ||
| <profileable android:shell="true"/> | ||
| </application> | ||
| </manifest> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.