your gradle profile shows the bottleneck isn’t kotlin itself, most of your time is in other tasks. compileKotlin is ~3m30s but npm:build is ~3m, detekt is over a minute, flyway/jooq add another minute. so even if the kotlin compiler was instant you’d still be waiting a long time.
first thing is stop running everything on every build. make a custom devRun task that only depends on classes or bootRun and use that for local development. don’t chain in npm, detekt, flyway or jooq unless you really need them. run those separately in CI.
npm:build right now probably has no declared outputs so gradle thinks it always has to run. declare inputs and outputs so gradle can skip it when nothing changes, or just skip it completely in dev and point your app at a local webpack/vite dev server instead.
same for jooq and flyway, don’t put them on the hot path. generate jooq sources only when the schema changes and point your sourceSets at the generated dir so gradle can cache it. flyway migrate/clean shouldn’t be part of every build at all, just run it explicitly.
detekt is heavy, best to move it to CI or make it opt in locally. if you keep it, at least disable type resolution when you’re just iterating.
also you’re using in-process compiler, switch to the kotlin daemon. in gradle.properties set kotlin.compiler.execution.strategy=daemon and also set kotlin.incremental=true and kotlin.incremental.useClasspathSnapshot=true so incremental compilation actually works. keep the daemon warm between builds.
turn on gradle features that cut config time: org.gradle.caching=true, org.gradle.parallel=true, org.gradle.configuration-cache=true, org.gradle.vfs.watch=true. with configuration cache and vfs watch you usually shave off 30–60 seconds right away.
set java and kotlin toolchains in your build so intellij and gradle are both using the same JDK. mismatched JDKs can cause unnecessary recompiles.
for hot reload, intellij’s hotswap is limited and often fails, that’s normal. if you really want it reliable, look at DCEVM + HotswapAgent or JRebel.
if you do decide to modularize, start small. you don’t need to split everything, just move out the slowest bits like the frontend, jooq, and migrations. even a couple of extra modules there can save a lot of time.
tl;dr stop running npm, detekt, flyway and jooq on every edit+compile, switch to the kotlin daemon and gradle configuration cache. doing just that usually drops “change one line” builds from 5–8 minutes to under a minute.