KMPCharts/app/build.gradle.kts
Trentin Davide e827deb806
Some checks failed
CI / build (push) Has been cancelled
perf(app): lighter stress demo + profileable release build
- StressTestScreen: use MinMaxLTTB LOD (caps output <= pixelWidth,
  ~half the vertices vs MinMax's ~2x) and move the sample generator
  loop to Dispatchers.Default so it stops contending with the UI thread.
- SignalGenerator: run the shared producer loop off the main thread.
- Add a release buildType (R8 + resource shrink, debuggable=false,
  debug-signed for on-device profiling); proguard-rules.pro needs no
  keeps (no kotlinx.serialization; Compose/coroutines ship consumer rules).
- minSdk 26 -> 24.

Off-main producer un-starves the feed (280 -> ~1300 push/s); release
build (AOT+R8) vs debug at matched load: CPU -12%, fps +48%.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 11:39:10 +02:00

58 lines
1.6 KiB
Kotlin

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
}
android {
namespace = "dev.dtrentin.chart.demo"
compileSdk = 35
defaultConfig {
applicationId = "dev.dtrentin.chart.demo"
minSdk = 24
targetSdk = 35
versionCode = 1
versionName = "0.1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures { compose = true }
buildTypes {
release {
isMinifyEnabled = true // R8 — the perf lever
isShrinkResources = true // strip unused resources
isDebuggable = false // let ART fully optimize (perf test)
// debug key so the release apk installs on a dev device (profiling build, not store build)
signingConfig = signingConfigs.getByName("debug")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
sourceSets["main"].kotlin.srcDirs("src/main/kotlin")
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
dependencies {
implementation(project(":chart-realtime"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.activity.compose)
implementation(libs.coroutines.core)
}