mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 19:57:04 +05:30
fix: remove benchmark project
This has barely ever worked and I'm kinda done with it
This commit is contained in:
parent
93b593bd41
commit
123e2c9eb2
11 changed files with 2 additions and 246 deletions
|
@ -23,7 +23,6 @@ plugins {
|
|||
alias(libs.plugins.anvil)
|
||||
alias(libs.plugins.modulegraphassert)
|
||||
alias(libs.plugins.whetstone)
|
||||
alias(libs.plugins.baselineprofile)
|
||||
alias(libs.plugins.licensee)
|
||||
alias(libs.plugins.tracelog)
|
||||
alias(libs.plugins.kotlin.composeCompiler)
|
||||
|
@ -47,13 +46,6 @@ extensions.configure<ApplicationExtension> {
|
|||
|
||||
aboutLibraries.collect.gitHubApiToken = providers.environmentVariable("GITHUB_TOKEN").orNull
|
||||
|
||||
baselineProfile {
|
||||
mergeIntoMain = true
|
||||
saveInSrc = true
|
||||
// dependencyProject is deprecated, needs new APIs in the baseline profile plugin.
|
||||
@Suppress("deprecation") from(projects.benchmark.dependencyProject)
|
||||
}
|
||||
|
||||
composeCompiler {
|
||||
featureFlags.addAll(
|
||||
ComposeFeatureFlag.OptimizeNonSkippingGroups,
|
||||
|
@ -145,7 +137,6 @@ dependencies {
|
|||
kapt(libs.dagger.compiler)
|
||||
|
||||
addTestDependencies(project)
|
||||
androidTestImplementation(libs.androidx.test.espresso.core)
|
||||
androidTestImplementation(libs.androidx.test.uiautomator)
|
||||
androidTestImplementation(libs.leakcanary.android.test)
|
||||
}
|
||||
|
|
1
benchmark/.gitignore
vendored
1
benchmark/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
/build
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright © Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
plugins {
|
||||
id(libs.plugins.android.test.get().pluginId)
|
||||
id("dev.msfjarvis.claw.kotlin-android")
|
||||
alias(libs.plugins.baselineprofile)
|
||||
alias(libs.plugins.dependencyAnalysis)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "dev.msfjarvis.claw.benchmark"
|
||||
|
||||
compileSdk = 34
|
||||
defaultConfig {
|
||||
minSdk = 28
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
create("benchmark") {
|
||||
isDebuggable = true
|
||||
signingConfig = signingConfigs["debug"]
|
||||
matchingFallbacks += "release"
|
||||
}
|
||||
}
|
||||
targetProjectPath = ":android"
|
||||
}
|
||||
|
||||
baselineProfile {
|
||||
useConnectedDevices = true
|
||||
enableEmulatorDisplay = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.benchmark.macro.junit4)
|
||||
implementation(libs.androidx.profileinstaller)
|
||||
implementation(libs.androidx.test.core)
|
||||
implementation(libs.androidx.test.espresso.core)
|
||||
implementation(libs.androidx.test.ext.junit)
|
||||
implementation(libs.androidx.test.rules)
|
||||
implementation(libs.androidx.test.runner)
|
||||
implementation(libs.androidx.test.uiautomator)
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
<!--
|
||||
~ Copyright © Harsh Shandilya.
|
||||
~ Use of this source code is governed by an MIT-style
|
||||
~ license that can be found in the LICENSE file or at
|
||||
~ https://opensource.org/licenses/MIT.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<queries>
|
||||
<package android:name="dev.msfjarvis.claw.android" />
|
||||
</queries>
|
||||
</manifest>
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* Copyright © Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.benchmark
|
||||
|
||||
import androidx.benchmark.macro.BaselineProfileMode
|
||||
import androidx.benchmark.macro.CompilationMode
|
||||
import androidx.benchmark.macro.FrameTimingMetric
|
||||
import androidx.benchmark.macro.StartupMode
|
||||
import androidx.benchmark.macro.StartupTimingMetric
|
||||
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class BaselineProfileBenchmark {
|
||||
@get:Rule val benchmarkRule = MacrobenchmarkRule()
|
||||
private lateinit var device: UiDevice
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
val instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
device = UiDevice.getInstance(instrumentation)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun noCompilation() {
|
||||
exploreUI(CompilationMode.None())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fullyCompiled() {
|
||||
exploreUI(CompilationMode.Full())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun baselineProfile() {
|
||||
exploreUI(CompilationMode.Partial(baselineProfileMode = BaselineProfileMode.Require))
|
||||
}
|
||||
|
||||
private fun exploreUI(compilationMode: CompilationMode) {
|
||||
benchmarkRule.measureRepeated(
|
||||
packageName = PACKAGE_NAME,
|
||||
metrics = listOf(FrameTimingMetric(), StartupTimingMetric()),
|
||||
compilationMode = compilationMode,
|
||||
startupMode = StartupMode.COLD,
|
||||
iterations = 10,
|
||||
) {
|
||||
device.executeShellCommand("pm clear $PACKAGE_NAME")
|
||||
|
||||
startActivityAndWait()
|
||||
|
||||
device.waitForIdle()
|
||||
|
||||
device.savePosts()
|
||||
|
||||
device.exploreScreens()
|
||||
|
||||
device.returnToHottestScreen()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* Copyright © Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.benchmark
|
||||
|
||||
import androidx.benchmark.macro.junit4.BaselineProfileRule
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class BaselineProfileGenerator {
|
||||
@get:Rule val baselineProfileRule = BaselineProfileRule()
|
||||
private lateinit var device: UiDevice
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
val instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
device = UiDevice.getInstance(instrumentation)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun generateBaselineProfile() =
|
||||
baselineProfileRule.collect(
|
||||
packageName = PACKAGE_NAME,
|
||||
maxIterations = 8,
|
||||
includeInStartupProfile = true,
|
||||
) {
|
||||
device.executeShellCommand("pm clear $PACKAGE_NAME")
|
||||
|
||||
startActivityAndWait()
|
||||
|
||||
device.waitForIdle()
|
||||
|
||||
device.savePosts()
|
||||
|
||||
device.exploreScreens()
|
||||
|
||||
device.returnToHottestScreen()
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Copyright © Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.benchmark
|
||||
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.BySelector
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.UiObject2
|
||||
import androidx.test.uiautomator.Until
|
||||
|
||||
const val PACKAGE_NAME = "dev.msfjarvis.claw.android"
|
||||
private const val AWAIT_TIMEOUT = 10_000L
|
||||
private const val SAVE_BUTTON_ID = "save_button"
|
||||
private const val NAV_ID_HOTTEST = "HOTTEST"
|
||||
private const val NAV_ID_NEWEST = "NEWEST"
|
||||
private const val NAV_ID_SAVED = "SAVED"
|
||||
|
||||
fun UiDevice.savePosts() {
|
||||
waitForObject(By.res(SAVE_BUTTON_ID)).click()
|
||||
}
|
||||
|
||||
fun UiDevice.exploreScreens() {
|
||||
listOf(NAV_ID_HOTTEST, NAV_ID_NEWEST, NAV_ID_SAVED).forEach { tag ->
|
||||
waitForObject(By.res(tag)).click()
|
||||
waitForIdle()
|
||||
}
|
||||
}
|
||||
|
||||
fun UiDevice.returnToHottestScreen() {
|
||||
waitForObject(By.res(NAV_ID_HOTTEST)).click()
|
||||
}
|
||||
|
||||
private fun UiDevice.waitForObject(selector: BySelector, timeout: Long = AWAIT_TIMEOUT): UiObject2 {
|
||||
if (wait(Until.hasObject(selector), timeout)) {
|
||||
return findObject(selector)
|
||||
}
|
||||
|
||||
error("Object with selector [$selector] not found")
|
||||
}
|
|
@ -23,7 +23,7 @@ class KotlinCommonPlugin : Plugin<Project> {
|
|||
override fun apply(project: Project) {
|
||||
if (project.isolated.rootProject == project.isolated) {
|
||||
LintConfig.configureRootProject(project)
|
||||
} else if (project.name != "benchmark") {
|
||||
} else {
|
||||
LintConfig.configureSubProject(project)
|
||||
}
|
||||
project.tasks.run {
|
||||
|
|
|
@ -46,7 +46,6 @@ class SentryPlugin : Plugin<Project> {
|
|||
autoUploadNativeSymbols.set(false)
|
||||
includeNativeSources.set(false)
|
||||
ignoredVariants.set(emptySet())
|
||||
ignoredBuildTypes.set(setOf("benchmark"))
|
||||
ignoredFlavors.set(emptySet())
|
||||
tracingInstrumentation {
|
||||
enabled.set(true)
|
||||
|
|
|
@ -3,7 +3,6 @@ aboutLibraries = "12.2.1"
|
|||
agp = "8.12.0-alpha03"
|
||||
android-junit5 = "1.12.2.0"
|
||||
androidx-test = "1.7.0-alpha03"
|
||||
benchmark = "1.4.0-beta02"
|
||||
coil3 = "3.2.0"
|
||||
coroutines = "1.10.2"
|
||||
dagger = "2.56.2"
|
||||
|
@ -32,7 +31,6 @@ workmanager = "2.10.1"
|
|||
aboutLibraries-m3 = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutLibraries" }
|
||||
android-security-lints = "com.android.security.lint:lint:1.0.3"
|
||||
androidx-activity-compose = "androidx.activity:activity-compose:1.11.0-rc01"
|
||||
androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "benchmark" }
|
||||
androidx-browser = "androidx.browser:browser:1.9.0-alpha04"
|
||||
androidx-compose-animation = { module = "androidx.compose.animation:animation" }
|
||||
androidx-compose-bom = "androidx.compose:compose-bom-alpha:2025.06.00"
|
||||
|
@ -60,11 +58,6 @@ androidx-navigation3-runtime = { module = "androidx.navigation3:navigation3-runt
|
|||
androidx-navigation3-ui = { module = "androidx.navigation3:navigation3-ui", version.ref = "navigation3" }
|
||||
androidx-paging-compose = "androidx.paging:paging-compose:3.3.6"
|
||||
androidx-profileinstaller = "androidx.profileinstaller:profileinstaller:1.4.1"
|
||||
androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-test" }
|
||||
androidx-test-espresso-core = "androidx.test.espresso:espresso-core:3.7.0-alpha03"
|
||||
androidx-test-ext-junit = "androidx.test.ext:junit:1.3.0-alpha03"
|
||||
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }
|
||||
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" }
|
||||
androidx-test-uiautomator = "androidx.test.uiautomator:uiautomator:2.4.0-alpha04"
|
||||
androidx-work-runtime = { module = "androidx.work:work-runtime", version.ref = "workmanager" }
|
||||
build-agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }
|
||||
|
@ -129,7 +122,6 @@ android-junit5 = { id = "de.mannodermaus.android-junit5", version.ref = "android
|
|||
android-lint = { id = "com.android.lint", version.ref = "agp" }
|
||||
android-test = { id = "com.android.test", version.ref = "agp" }
|
||||
anvil = "com.squareup.anvil:2.5.1"
|
||||
baselineprofile = { id = "androidx.baselineprofile", version.ref = "benchmark" }
|
||||
dependencyAnalysis = "com.autonomousapps.dependency-analysis:2.18.0"
|
||||
invert = "com.squareup.invert:0.0.3-dev"
|
||||
kotlin-composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||
|
|
|
@ -127,14 +127,4 @@ rootProject.name = "Claw"
|
|||
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
|
||||
include(
|
||||
"android",
|
||||
"api",
|
||||
"benchmark",
|
||||
"common",
|
||||
"core",
|
||||
"database:core",
|
||||
"database:impl",
|
||||
"model",
|
||||
"web",
|
||||
)
|
||||
include("android", "api", "common", "core", "database:core", "database:impl", "model", "web")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue