Vanilla Dagger 2 via KAPT vs KSP on a small JVM pr...
# dagger
t
Vanilla Dagger 2 via KAPT vs KSP on a small JVM project: 16 sub projects, 4 using the dagger processor, ~5k lines of kotlin total ~25% on a cold daemon, ~10% after warm-up seems we might see some big wins at scale. bits to make the profiler be able to quickly control which is used.
Copy code
val useKsp: String by project
if(useKsp.toBooleanStrict()) {
  apply(plugin = "com.google.devtools.ksp")
  dependencies {
    implementation(libs.dagger)
    "ksp"(libs.dagger.compiler)
    "kspTest"(libs.dagger.compiler)
  }
} else {
  apply(plugin = "org.jetbrains.kotlin.kapt")
  dependencies {
    implementation(libs.dagger)
    "kapt"(libs.dagger.compiler)
    "kaptTest"(libs.dagger.compiler)
  }
}
🎉 4
scenarios:
Copy code
assembleKapt {
    tasks = ["assemble"]
    gradle-args = ["-Dscan.tag.KspDagger", "--rerun-tasks", "-Dscan.tag.assembleKapt", "-PuseKsp=false"]
    run-using = tooling-api
    daemon = warm
    warm-ups = 1
    iterations = 5
}

assembleKsp {
    tasks = ["assemble"]
    gradle-args = ["-Dscan.tag.KspDagger", "--rerun-tasks", "-Dscan.tag.assembleKsp", "-PuseKsp=true"]
    run-using = tooling-api
    daemon = warm
    warm-ups = 1
    iterations = 5
}
c
thanks for that breakdown of what tasks were actually run. cheers
👍 1