[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-kotlin-kotlin-tooling-native-build-performance":3,"mdc-ola94z-key":35,"related-org-kotlin-kotlin-tooling-native-build-performance":992,"related-repo-kotlin-kotlin-tooling-native-build-performance":1082},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":30,"sourceUrl":33,"mdContent":34},"kotlin-tooling-native-build-performance","optimize Kotlin Native build performance","Diagnoses and fixes slow Kotlin\u002FNative compilation and linking in Kotlin Multiplatform projects that target iOS. Use when the user reports slow iOS or shared-framework builds, long linkDebug*\u002FlinkRelease* or XCFramework tasks, cold CI builds that re-download the Kotlin\u002FNative toolchain, KSP or other generated code on the native path, transitiveExport usage, or asks for a local-development versus CI build performance plan.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"kotlin","Kotlin","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fkotlin.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"iOS","ios",{"name":21,"slug":22,"type":15},"Mobile","mobile",963,"https:\u002F\u002Fgithub.com\u002FKotlin\u002Fkotlin-agent-skills","2026-07-18T05:47:25.998032","Apache-2.0",35,[8,29],"skills",{"repoUrl":24,"stars":23,"forks":27,"topics":31,"description":32},[8,29],"A collection of AI agent skills useful for projects using Kotlin language","https:\u002F\u002Fgithub.com\u002FKotlin\u002Fkotlin-agent-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fkotlin-tooling-native-build-performance","---\nname: kotlin-tooling-native-build-performance\ndescription: >\n  Diagnoses and fixes slow Kotlin\u002FNative compilation and linking in Kotlin\n  Multiplatform projects that target iOS. Use when the user reports slow iOS or\n  shared-framework builds, long linkDebug*\u002FlinkRelease* or XCFramework tasks,\n  cold CI builds that re-download the Kotlin\u002FNative toolchain, KSP or other\n  generated code on the native path, transitiveExport usage, or asks for a\n  local-development versus CI build performance plan.\nlicense: Apache-2.0\nmetadata:\n  author: JetBrains\n  version: \"1.0.0\"\n  tested_models: \"openai\u002Fgpt-5.5, openai\u002Fgpt-5.4-mini\"\n  last_eval: \"2026-07-06\"\n---\n\n# Kotlin\u002FNative Build Performance\n\nTurn \"the iOS build is slow\" into a measured diagnosis and a small set of safe\nfixes. Two rules apply throughout:\n\n1. Never trade away required release behavior. A faster local loop must not\n   change what CI publishes.\n2. Measure before and after with the same command and the same build state.\n   An unmeasured fix is a guess.\n\n## Step 0: Classify the Slow Scenario\n\nEstablish four facts before editing anything: **where** (local or CI),\n**what** (debug feedback loop or release\u002Fdistribution artifact), **state**\n(first build, clean, warm, or no-op), and **phase** (which tasks dominate the\nlog). Then match the dominant symptom:\n\n| Symptom in the build log | Likely cause | Read |\n|---|---|---|\n| `linkRelease*` or `*ReleaseXCFramework` tasks in a local development loop | Building distribution artifacts for development | [artifacts-and-targets](references\u002Fartifacts-and-targets.md) |\n| Kotlin\u002FNative compiler distribution downloaded on every CI run | `~\u002F.konan` not preserved between runs | [caching-and-gradle](references\u002Fcaching-and-gradle.md) |\n| Long pause before the first task starts | Configuration phase, no configuration cache | [caching-and-gradle](references\u002Fcaching-and-gradle.md) |\n| All iOS targets build when only one simulator is needed | Broad task (`build`, `assemble`, `assemble*XCFramework`) or unused targets | [artifacts-and-targets](references\u002Fartifacts-and-targets.md) |\n| `ksp*` tasks ahead of `compileKotlinIos*` | Generated-code work on the native path | [exports-and-generated-code](references\u002Fexports-and-generated-code.md) |\n| Small source edit recompiles and relinks everything | Compiler caches disabled, or missing incrementality | [caching-and-gradle](references\u002Fcaching-and-gradle.md), [experimental](references\u002Fexperimental.md) |\n| Machine overloaded while several `link*` tasks run at once | Parallel native linking | [caching-and-gradle](references\u002Fcaching-and-gradle.md), worker-limit caveat |\n\n## Step 1: Audit and Measure\n\n1. Run the static audit from the project root:\n\n   ```bash\n   scripts\u002Faudit-native-build.sh \u002Fpath\u002Fto\u002Fproject\n   ```\n\n   It is read-only and prints `file:line` findings (disabled caches, broad\n   local tasks, `transitiveExport`, broad KSP configuration, missing CI\n   `.konan` cache), each pointing at the reference file with the fix.\n   Findings are leads, not verdicts — confirm each against project policy.\n2. Find the command the user actually waits for: a script, a CI step, or the\n   Gradle invocation inside an Xcode build phase. Optimize that command, not\n   a task you picked yourself.\n3. Run it twice when practical. The first build downloads Kotlin\u002FNative\n   components and fills caches; only the second and later runs are\n   representative. Attribute time per task before blaming the compiler:\n\n   ```properties\n   kotlin.build.report.output=file   # writes build\u002Freports\u002Fkotlin-build\u002F\n   ```\n\n   Gradle's `--scan` or `--profile` work too.\n4. If you cannot run the build (no macOS host, no Xcode), analyze logs, build\n   scans, or checked-in metrics instead — and state explicitly that the\n   conclusion is static.\n\n## Step 2: Fix in Safe Order\n\nApply fixes one at a time, re-measuring as you go:\n\n1. **Restore healthy defaults** — remove cache\u002Fdaemon workarounds, enable\n   Gradle build and configuration caches, keep `~\u002F.konan` warm in CI, update\n   Kotlin: [references\u002Fcaching-and-gradle.md](references\u002Fcaching-and-gradle.md)\n2. **Build only what the feedback loop needs** — one specific task per loop,\n   correct integration method, justified target matrix:\n   [references\u002Fartifacts-and-targets.md](references\u002Fartifacts-and-targets.md)\n3. **Cut export and generated-code cost** — drop `transitiveExport`, narrow\n   `export(...)`, scope KSP work to the native compilations that need it:\n   [references\u002Fexports-and-generated-code.md](references\u002Fexports-and-generated-code.md)\n4. **Experimental switches last, with the user's agreement**:\n   [references\u002Fexperimental.md](references\u002Fexperimental.md)\n\n## Worked Example\n\nA developer on an Apple Silicon Mac complains that \"every shared-module\nchange costs 12 minutes\". Their loop runs `.\u002Fgradlew :shared:assembleXCFramework`.\nA build scan of the second (warm) run shows:\n\n```\n:shared:linkReleaseFrameworkIosArm64             348s\n:shared:linkReleaseFrameworkIosX64               341s\n:shared:compileKotlinIosX64                       96s\n:shared:linkDebugFrameworkIosSimulatorArm64       41s\n:shared:compileKotlinIosSimulatorArm64            38s\nconfiguration phase                               64s\n```\n\nReasoning chain:\n\n- The loop is **local + debug + warm**, but ~690s goes to `linkRelease*` —\n  release linking is an order of magnitude slower than debug and only CI\n  needs it. Replace the local command with\n  `:shared:linkDebugFrameworkIosSimulatorArm64` (or the Xcode embed task if\n  Xcode drives the build). *(artifacts-and-targets)*\n- All `iosX64` work serves Intel simulators; ask whether the team still\n  supports them before removing the target. *(artifacts-and-targets)*\n- 64s of configuration on every run disappears behind\n  `org.gradle.configuration-cache=true` once trialed. *(caching-and-gradle)*\n- Expected loop after the change: ~40s compile + ~40s link on warm builds —\n  confirm by re-running the new command twice and comparing.\n- CI keeps `assembleXCFramework` untouched; note that explicitly in the\n  report.\n\n## Verify\n\n- [ ] Re-run the exact baseline command; compare warm build against warm\n      build, not warm against cold.\n- [ ] Second run with the configuration cache reports it is being reused.\n- [ ] The local development log no longer contains `linkRelease*`,\n      `*ReleaseXCFramework`, or removed generator tasks.\n- [ ] CI still produces every required release artifact, unchanged.\n- [ ] Tests pass and the app still runs from Xcode.\n- [ ] `scripts\u002Faudit-native-build.sh` reports no findings you have not\n      consciously accepted and documented.\n\n## Report Your Changes\n\nClose with a short performance note:\n\n- The slow scenario (local\u002FCI, debug\u002Frelease, cold\u002Fwarm) and the measured\n  evidence — or a statement that the analysis was static.\n- Each change, and why it is safe for release behavior.\n- The before\u002Fafter commands the user can run to confirm the win.\n- Remaining tradeoffs: experimental flags enabled, targets removed under a\n  policy assumption, worker limits, or generated-code work deferred.\n- Links to the relevant official documentation below.\n\n## Official Documentation\n\n| Topic | Link |\n|---|---|\n| Improving Kotlin\u002FNative compilation time | https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fnative-improving-compilation-time.html |\n| Kotlin Gradle plugin compilation and caches | https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fgradle-compilation-and-caches.html |\n| iOS integration methods | https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fmultiplatform-ios-integration-overview.html |\n| Direct integration with Xcode | https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fmultiplatform\u002Fmultiplatform-direct-integration.html |\n| Building final native binaries and XCFrameworks | https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fmultiplatform\u002Fmultiplatform-build-native-binaries.html |\n| Kotlin\u002FNative binary options | https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fnative-binary-options.html |\n| KSP with Kotlin Multiplatform | https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fksp-multiplatform.html |\n",{"data":36,"body":42},{"name":4,"description":6,"license":26,"metadata":37},{"author":38,"version":39,"tested_models":40,"last_eval":41},"JetBrains","1.0.0","openai\u002Fgpt-5.5, openai\u002Fgpt-5.4-mini","2026-07-06",{"type":43,"children":44},"root",[45,54,60,75,82,116,369,375,493,499,504,585,591,604,614,619,709,715,799,805,810,838,844,986],{"type":46,"tag":47,"props":48,"children":50},"element","h1",{"id":49},"kotlinnative-build-performance",[51],{"type":52,"value":53},"text","Kotlin\u002FNative Build Performance",{"type":46,"tag":55,"props":56,"children":57},"p",{},[58],{"type":52,"value":59},"Turn \"the iOS build is slow\" into a measured diagnosis and a small set of safe\nfixes. Two rules apply throughout:",{"type":46,"tag":61,"props":62,"children":63},"ol",{},[64,70],{"type":46,"tag":65,"props":66,"children":67},"li",{},[68],{"type":52,"value":69},"Never trade away required release behavior. A faster local loop must not\nchange what CI publishes.",{"type":46,"tag":65,"props":71,"children":72},{},[73],{"type":52,"value":74},"Measure before and after with the same command and the same build state.\nAn unmeasured fix is a guess.",{"type":46,"tag":76,"props":77,"children":79},"h2",{"id":78},"step-0-classify-the-slow-scenario",[80],{"type":52,"value":81},"Step 0: Classify the Slow Scenario",{"type":46,"tag":55,"props":83,"children":84},{},[85,87,93,95,100,102,107,109,114],{"type":52,"value":86},"Establish four facts before editing anything: ",{"type":46,"tag":88,"props":89,"children":90},"strong",{},[91],{"type":52,"value":92},"where",{"type":52,"value":94}," (local or CI),\n",{"type":46,"tag":88,"props":96,"children":97},{},[98],{"type":52,"value":99},"what",{"type":52,"value":101}," (debug feedback loop or release\u002Fdistribution artifact), ",{"type":46,"tag":88,"props":103,"children":104},{},[105],{"type":52,"value":106},"state",{"type":52,"value":108},"\n(first build, clean, warm, or no-op), and ",{"type":46,"tag":88,"props":110,"children":111},{},[112],{"type":52,"value":113},"phase",{"type":52,"value":115}," (which tasks dominate the\nlog). Then match the dominant symptom:",{"type":46,"tag":117,"props":118,"children":119},"table",{},[120,144],{"type":46,"tag":121,"props":122,"children":123},"thead",{},[124],{"type":46,"tag":125,"props":126,"children":127},"tr",{},[128,134,139],{"type":46,"tag":129,"props":130,"children":131},"th",{},[132],{"type":52,"value":133},"Symptom in the build log",{"type":46,"tag":129,"props":135,"children":136},{},[137],{"type":52,"value":138},"Likely cause",{"type":46,"tag":129,"props":140,"children":141},{},[142],{"type":52,"value":143},"Read",{"type":46,"tag":145,"props":146,"children":147},"tbody",{},[148,187,215,235,278,312,339],{"type":46,"tag":125,"props":149,"children":150},{},[151,172,177],{"type":46,"tag":152,"props":153,"children":154},"td",{},[155,162,164,170],{"type":46,"tag":156,"props":157,"children":159},"code",{"className":158},[],[160],{"type":52,"value":161},"linkRelease*",{"type":52,"value":163}," or ",{"type":46,"tag":156,"props":165,"children":167},{"className":166},[],[168],{"type":52,"value":169},"*ReleaseXCFramework",{"type":52,"value":171}," tasks in a local development loop",{"type":46,"tag":152,"props":173,"children":174},{},[175],{"type":52,"value":176},"Building distribution artifacts for development",{"type":46,"tag":152,"props":178,"children":179},{},[180],{"type":46,"tag":181,"props":182,"children":184},"a",{"href":183},"references\u002Fartifacts-and-targets.md",[185],{"type":52,"value":186},"artifacts-and-targets",{"type":46,"tag":125,"props":188,"children":189},{},[190,195,206],{"type":46,"tag":152,"props":191,"children":192},{},[193],{"type":52,"value":194},"Kotlin\u002FNative compiler distribution downloaded on every CI run",{"type":46,"tag":152,"props":196,"children":197},{},[198,204],{"type":46,"tag":156,"props":199,"children":201},{"className":200},[],[202],{"type":52,"value":203},"~\u002F.konan",{"type":52,"value":205}," not preserved between runs",{"type":46,"tag":152,"props":207,"children":208},{},[209],{"type":46,"tag":181,"props":210,"children":212},{"href":211},"references\u002Fcaching-and-gradle.md",[213],{"type":52,"value":214},"caching-and-gradle",{"type":46,"tag":125,"props":216,"children":217},{},[218,223,228],{"type":46,"tag":152,"props":219,"children":220},{},[221],{"type":52,"value":222},"Long pause before the first task starts",{"type":46,"tag":152,"props":224,"children":225},{},[226],{"type":52,"value":227},"Configuration phase, no configuration cache",{"type":46,"tag":152,"props":229,"children":230},{},[231],{"type":46,"tag":181,"props":232,"children":233},{"href":211},[234],{"type":52,"value":214},{"type":46,"tag":125,"props":236,"children":237},{},[238,243,271],{"type":46,"tag":152,"props":239,"children":240},{},[241],{"type":52,"value":242},"All iOS targets build when only one simulator is needed",{"type":46,"tag":152,"props":244,"children":245},{},[246,248,254,256,262,263,269],{"type":52,"value":247},"Broad task (",{"type":46,"tag":156,"props":249,"children":251},{"className":250},[],[252],{"type":52,"value":253},"build",{"type":52,"value":255},", ",{"type":46,"tag":156,"props":257,"children":259},{"className":258},[],[260],{"type":52,"value":261},"assemble",{"type":52,"value":255},{"type":46,"tag":156,"props":264,"children":266},{"className":265},[],[267],{"type":52,"value":268},"assemble*XCFramework",{"type":52,"value":270},") or unused targets",{"type":46,"tag":152,"props":272,"children":273},{},[274],{"type":46,"tag":181,"props":275,"children":276},{"href":183},[277],{"type":52,"value":186},{"type":46,"tag":125,"props":279,"children":280},{},[281,298,303],{"type":46,"tag":152,"props":282,"children":283},{},[284,290,292],{"type":46,"tag":156,"props":285,"children":287},{"className":286},[],[288],{"type":52,"value":289},"ksp*",{"type":52,"value":291}," tasks ahead of ",{"type":46,"tag":156,"props":293,"children":295},{"className":294},[],[296],{"type":52,"value":297},"compileKotlinIos*",{"type":46,"tag":152,"props":299,"children":300},{},[301],{"type":52,"value":302},"Generated-code work on the native path",{"type":46,"tag":152,"props":304,"children":305},{},[306],{"type":46,"tag":181,"props":307,"children":309},{"href":308},"references\u002Fexports-and-generated-code.md",[310],{"type":52,"value":311},"exports-and-generated-code",{"type":46,"tag":125,"props":313,"children":314},{},[315,320,325],{"type":46,"tag":152,"props":316,"children":317},{},[318],{"type":52,"value":319},"Small source edit recompiles and relinks everything",{"type":46,"tag":152,"props":321,"children":322},{},[323],{"type":52,"value":324},"Compiler caches disabled, or missing incrementality",{"type":46,"tag":152,"props":326,"children":327},{},[328,332,333],{"type":46,"tag":181,"props":329,"children":330},{"href":211},[331],{"type":52,"value":214},{"type":52,"value":255},{"type":46,"tag":181,"props":334,"children":336},{"href":335},"references\u002Fexperimental.md",[337],{"type":52,"value":338},"experimental",{"type":46,"tag":125,"props":340,"children":341},{},[342,355,360],{"type":46,"tag":152,"props":343,"children":344},{},[345,347,353],{"type":52,"value":346},"Machine overloaded while several ",{"type":46,"tag":156,"props":348,"children":350},{"className":349},[],[351],{"type":52,"value":352},"link*",{"type":52,"value":354}," tasks run at once",{"type":46,"tag":152,"props":356,"children":357},{},[358],{"type":52,"value":359},"Parallel native linking",{"type":46,"tag":152,"props":361,"children":362},{},[363,367],{"type":46,"tag":181,"props":364,"children":365},{"href":211},[366],{"type":52,"value":214},{"type":52,"value":368},", worker-limit caveat",{"type":46,"tag":76,"props":370,"children":372},{"id":371},"step-1-audit-and-measure",[373],{"type":52,"value":374},"Step 1: Audit and Measure",{"type":46,"tag":61,"props":376,"children":377},{},[378,442,447,488],{"type":46,"tag":65,"props":379,"children":380},{},[381,383,412,416,418,424,426,432,434,440],{"type":52,"value":382},"Run the static audit from the project root:",{"type":46,"tag":384,"props":385,"children":390},"pre",{"className":386,"code":387,"language":388,"meta":389,"style":389},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","scripts\u002Faudit-native-build.sh \u002Fpath\u002Fto\u002Fproject\n","bash","",[391],{"type":46,"tag":156,"props":392,"children":393},{"__ignoreMap":389},[394],{"type":46,"tag":395,"props":396,"children":399},"span",{"class":397,"line":398},"line",1,[400,406],{"type":46,"tag":395,"props":401,"children":403},{"style":402},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[404],{"type":52,"value":405},"scripts\u002Faudit-native-build.sh",{"type":46,"tag":395,"props":407,"children":409},{"style":408},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[410],{"type":52,"value":411}," \u002Fpath\u002Fto\u002Fproject\n",{"type":46,"tag":413,"props":414,"children":415},"br",{},[],{"type":52,"value":417},"It is read-only and prints ",{"type":46,"tag":156,"props":419,"children":421},{"className":420},[],[422],{"type":52,"value":423},"file:line",{"type":52,"value":425}," findings (disabled caches, broad\nlocal tasks, ",{"type":46,"tag":156,"props":427,"children":429},{"className":428},[],[430],{"type":52,"value":431},"transitiveExport",{"type":52,"value":433},", broad KSP configuration, missing CI\n",{"type":46,"tag":156,"props":435,"children":437},{"className":436},[],[438],{"type":52,"value":439},".konan",{"type":52,"value":441}," cache), each pointing at the reference file with the fix.\nFindings are leads, not verdicts — confirm each against project policy.",{"type":46,"tag":65,"props":443,"children":444},{},[445],{"type":52,"value":446},"Find the command the user actually waits for: a script, a CI step, or the\nGradle invocation inside an Xcode build phase. Optimize that command, not\na task you picked yourself.",{"type":46,"tag":65,"props":448,"children":449},{},[450,452,468,471,473,479,480,486],{"type":52,"value":451},"Run it twice when practical. The first build downloads Kotlin\u002FNative\ncomponents and fills caches; only the second and later runs are\nrepresentative. Attribute time per task before blaming the compiler:",{"type":46,"tag":384,"props":453,"children":457},{"className":454,"code":455,"language":456,"meta":389,"style":389},"language-properties shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","kotlin.build.report.output=file   # writes build\u002Freports\u002Fkotlin-build\u002F\n","properties",[458],{"type":46,"tag":156,"props":459,"children":460},{"__ignoreMap":389},[461],{"type":46,"tag":395,"props":462,"children":463},{"class":397,"line":398},[464],{"type":46,"tag":395,"props":465,"children":466},{},[467],{"type":52,"value":455},{"type":46,"tag":413,"props":469,"children":470},{},[],{"type":52,"value":472},"Gradle's ",{"type":46,"tag":156,"props":474,"children":476},{"className":475},[],[477],{"type":52,"value":478},"--scan",{"type":52,"value":163},{"type":46,"tag":156,"props":481,"children":483},{"className":482},[],[484],{"type":52,"value":485},"--profile",{"type":52,"value":487}," work too.",{"type":46,"tag":65,"props":489,"children":490},{},[491],{"type":52,"value":492},"If you cannot run the build (no macOS host, no Xcode), analyze logs, build\nscans, or checked-in metrics instead — and state explicitly that the\nconclusion is static.",{"type":46,"tag":76,"props":494,"children":496},{"id":495},"step-2-fix-in-safe-order",[497],{"type":52,"value":498},"Step 2: Fix in Safe Order",{"type":46,"tag":55,"props":500,"children":501},{},[502],{"type":52,"value":503},"Apply fixes one at a time, re-measuring as you go:",{"type":46,"tag":61,"props":505,"children":506},{},[507,528,542,571],{"type":46,"tag":65,"props":508,"children":509},{},[510,515,517,522,524],{"type":46,"tag":88,"props":511,"children":512},{},[513],{"type":52,"value":514},"Restore healthy defaults",{"type":52,"value":516}," — remove cache\u002Fdaemon workarounds, enable\nGradle build and configuration caches, keep ",{"type":46,"tag":156,"props":518,"children":520},{"className":519},[],[521],{"type":52,"value":203},{"type":52,"value":523}," warm in CI, update\nKotlin: ",{"type":46,"tag":181,"props":525,"children":526},{"href":211},[527],{"type":52,"value":211},{"type":46,"tag":65,"props":529,"children":530},{},[531,536,538],{"type":46,"tag":88,"props":532,"children":533},{},[534],{"type":52,"value":535},"Build only what the feedback loop needs",{"type":52,"value":537}," — one specific task per loop,\ncorrect integration method, justified target matrix:\n",{"type":46,"tag":181,"props":539,"children":540},{"href":183},[541],{"type":52,"value":183},{"type":46,"tag":65,"props":543,"children":544},{},[545,550,552,557,559,565,567],{"type":46,"tag":88,"props":546,"children":547},{},[548],{"type":52,"value":549},"Cut export and generated-code cost",{"type":52,"value":551}," — drop ",{"type":46,"tag":156,"props":553,"children":555},{"className":554},[],[556],{"type":52,"value":431},{"type":52,"value":558},", narrow\n",{"type":46,"tag":156,"props":560,"children":562},{"className":561},[],[563],{"type":52,"value":564},"export(...)",{"type":52,"value":566},", scope KSP work to the native compilations that need it:\n",{"type":46,"tag":181,"props":568,"children":569},{"href":308},[570],{"type":52,"value":308},{"type":46,"tag":65,"props":572,"children":573},{},[574,579,581],{"type":46,"tag":88,"props":575,"children":576},{},[577],{"type":52,"value":578},"Experimental switches last, with the user's agreement",{"type":52,"value":580},":\n",{"type":46,"tag":181,"props":582,"children":583},{"href":335},[584],{"type":52,"value":335},{"type":46,"tag":76,"props":586,"children":588},{"id":587},"worked-example",[589],{"type":52,"value":590},"Worked Example",{"type":46,"tag":55,"props":592,"children":593},{},[594,596,602],{"type":52,"value":595},"A developer on an Apple Silicon Mac complains that \"every shared-module\nchange costs 12 minutes\". Their loop runs ",{"type":46,"tag":156,"props":597,"children":599},{"className":598},[],[600],{"type":52,"value":601},".\u002Fgradlew :shared:assembleXCFramework",{"type":52,"value":603},".\nA build scan of the second (warm) run shows:",{"type":46,"tag":384,"props":605,"children":609},{"className":606,"code":608,"language":52},[607],"language-text",":shared:linkReleaseFrameworkIosArm64             348s\n:shared:linkReleaseFrameworkIosX64               341s\n:shared:compileKotlinIosX64                       96s\n:shared:linkDebugFrameworkIosSimulatorArm64       41s\n:shared:compileKotlinIosSimulatorArm64            38s\nconfiguration phase                               64s\n",[610],{"type":46,"tag":156,"props":611,"children":612},{"__ignoreMap":389},[613],{"type":52,"value":608},{"type":46,"tag":55,"props":615,"children":616},{},[617],{"type":52,"value":618},"Reasoning chain:",{"type":46,"tag":620,"props":621,"children":622},"ul",{},[623,656,673,691,696],{"type":46,"tag":65,"props":624,"children":625},{},[626,628,633,635,640,642,648,650],{"type":52,"value":627},"The loop is ",{"type":46,"tag":88,"props":629,"children":630},{},[631],{"type":52,"value":632},"local + debug + warm",{"type":52,"value":634},", but ~690s goes to ",{"type":46,"tag":156,"props":636,"children":638},{"className":637},[],[639],{"type":52,"value":161},{"type":52,"value":641}," —\nrelease linking is an order of magnitude slower than debug and only CI\nneeds it. Replace the local command with\n",{"type":46,"tag":156,"props":643,"children":645},{"className":644},[],[646],{"type":52,"value":647},":shared:linkDebugFrameworkIosSimulatorArm64",{"type":52,"value":649}," (or the Xcode embed task if\nXcode drives the build). ",{"type":46,"tag":651,"props":652,"children":653},"em",{},[654],{"type":52,"value":655},"(artifacts-and-targets)",{"type":46,"tag":65,"props":657,"children":658},{},[659,661,667,669],{"type":52,"value":660},"All ",{"type":46,"tag":156,"props":662,"children":664},{"className":663},[],[665],{"type":52,"value":666},"iosX64",{"type":52,"value":668}," work serves Intel simulators; ask whether the team still\nsupports them before removing the target. ",{"type":46,"tag":651,"props":670,"children":671},{},[672],{"type":52,"value":655},{"type":46,"tag":65,"props":674,"children":675},{},[676,678,684,686],{"type":52,"value":677},"64s of configuration on every run disappears behind\n",{"type":46,"tag":156,"props":679,"children":681},{"className":680},[],[682],{"type":52,"value":683},"org.gradle.configuration-cache=true",{"type":52,"value":685}," once trialed. ",{"type":46,"tag":651,"props":687,"children":688},{},[689],{"type":52,"value":690},"(caching-and-gradle)",{"type":46,"tag":65,"props":692,"children":693},{},[694],{"type":52,"value":695},"Expected loop after the change: ~40s compile + ~40s link on warm builds —\nconfirm by re-running the new command twice and comparing.",{"type":46,"tag":65,"props":697,"children":698},{},[699,701,707],{"type":52,"value":700},"CI keeps ",{"type":46,"tag":156,"props":702,"children":704},{"className":703},[],[705],{"type":52,"value":706},"assembleXCFramework",{"type":52,"value":708}," untouched; note that explicitly in the\nreport.",{"type":46,"tag":76,"props":710,"children":712},{"id":711},"verify",[713],{"type":52,"value":714},"Verify",{"type":46,"tag":620,"props":716,"children":719},{"className":717},[718],"contains-task-list",[720,733,742,765,774,783],{"type":46,"tag":65,"props":721,"children":724},{"className":722},[723],"task-list-item",[725,731],{"type":46,"tag":726,"props":727,"children":730},"input",{"disabled":728,"type":729},true,"checkbox",[],{"type":52,"value":732}," Re-run the exact baseline command; compare warm build against warm\nbuild, not warm against cold.",{"type":46,"tag":65,"props":734,"children":736},{"className":735},[723],[737,740],{"type":46,"tag":726,"props":738,"children":739},{"disabled":728,"type":729},[],{"type":52,"value":741}," Second run with the configuration cache reports it is being reused.",{"type":46,"tag":65,"props":743,"children":745},{"className":744},[723],[746,749,751,756,758,763],{"type":46,"tag":726,"props":747,"children":748},{"disabled":728,"type":729},[],{"type":52,"value":750}," The local development log no longer contains ",{"type":46,"tag":156,"props":752,"children":754},{"className":753},[],[755],{"type":52,"value":161},{"type":52,"value":757},",\n",{"type":46,"tag":156,"props":759,"children":761},{"className":760},[],[762],{"type":52,"value":169},{"type":52,"value":764},", or removed generator tasks.",{"type":46,"tag":65,"props":766,"children":768},{"className":767},[723],[769,772],{"type":46,"tag":726,"props":770,"children":771},{"disabled":728,"type":729},[],{"type":52,"value":773}," CI still produces every required release artifact, unchanged.",{"type":46,"tag":65,"props":775,"children":777},{"className":776},[723],[778,781],{"type":46,"tag":726,"props":779,"children":780},{"disabled":728,"type":729},[],{"type":52,"value":782}," Tests pass and the app still runs from Xcode.",{"type":46,"tag":65,"props":784,"children":786},{"className":785},[723],[787,790,792,797],{"type":46,"tag":726,"props":788,"children":789},{"disabled":728,"type":729},[],{"type":52,"value":791}," ",{"type":46,"tag":156,"props":793,"children":795},{"className":794},[],[796],{"type":52,"value":405},{"type":52,"value":798}," reports no findings you have not\nconsciously accepted and documented.",{"type":46,"tag":76,"props":800,"children":802},{"id":801},"report-your-changes",[803],{"type":52,"value":804},"Report Your Changes",{"type":46,"tag":55,"props":806,"children":807},{},[808],{"type":52,"value":809},"Close with a short performance note:",{"type":46,"tag":620,"props":811,"children":812},{},[813,818,823,828,833],{"type":46,"tag":65,"props":814,"children":815},{},[816],{"type":52,"value":817},"The slow scenario (local\u002FCI, debug\u002Frelease, cold\u002Fwarm) and the measured\nevidence — or a statement that the analysis was static.",{"type":46,"tag":65,"props":819,"children":820},{},[821],{"type":52,"value":822},"Each change, and why it is safe for release behavior.",{"type":46,"tag":65,"props":824,"children":825},{},[826],{"type":52,"value":827},"The before\u002Fafter commands the user can run to confirm the win.",{"type":46,"tag":65,"props":829,"children":830},{},[831],{"type":52,"value":832},"Remaining tradeoffs: experimental flags enabled, targets removed under a\npolicy assumption, worker limits, or generated-code work deferred.",{"type":46,"tag":65,"props":834,"children":835},{},[836],{"type":52,"value":837},"Links to the relevant official documentation below.",{"type":46,"tag":76,"props":839,"children":841},{"id":840},"official-documentation",[842],{"type":52,"value":843},"Official Documentation",{"type":46,"tag":117,"props":845,"children":846},{},[847,863],{"type":46,"tag":121,"props":848,"children":849},{},[850],{"type":46,"tag":125,"props":851,"children":852},{},[853,858],{"type":46,"tag":129,"props":854,"children":855},{},[856],{"type":52,"value":857},"Topic",{"type":46,"tag":129,"props":859,"children":860},{},[861],{"type":52,"value":862},"Link",{"type":46,"tag":145,"props":864,"children":865},{},[866,884,901,918,935,952,969],{"type":46,"tag":125,"props":867,"children":868},{},[869,874],{"type":46,"tag":152,"props":870,"children":871},{},[872],{"type":52,"value":873},"Improving Kotlin\u002FNative compilation time",{"type":46,"tag":152,"props":875,"children":876},{},[877],{"type":46,"tag":181,"props":878,"children":882},{"href":879,"rel":880},"https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fnative-improving-compilation-time.html",[881],"nofollow",[883],{"type":52,"value":879},{"type":46,"tag":125,"props":885,"children":886},{},[887,892],{"type":46,"tag":152,"props":888,"children":889},{},[890],{"type":52,"value":891},"Kotlin Gradle plugin compilation and caches",{"type":46,"tag":152,"props":893,"children":894},{},[895],{"type":46,"tag":181,"props":896,"children":899},{"href":897,"rel":898},"https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fgradle-compilation-and-caches.html",[881],[900],{"type":52,"value":897},{"type":46,"tag":125,"props":902,"children":903},{},[904,909],{"type":46,"tag":152,"props":905,"children":906},{},[907],{"type":52,"value":908},"iOS integration methods",{"type":46,"tag":152,"props":910,"children":911},{},[912],{"type":46,"tag":181,"props":913,"children":916},{"href":914,"rel":915},"https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fmultiplatform-ios-integration-overview.html",[881],[917],{"type":52,"value":914},{"type":46,"tag":125,"props":919,"children":920},{},[921,926],{"type":46,"tag":152,"props":922,"children":923},{},[924],{"type":52,"value":925},"Direct integration with Xcode",{"type":46,"tag":152,"props":927,"children":928},{},[929],{"type":46,"tag":181,"props":930,"children":933},{"href":931,"rel":932},"https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fmultiplatform\u002Fmultiplatform-direct-integration.html",[881],[934],{"type":52,"value":931},{"type":46,"tag":125,"props":936,"children":937},{},[938,943],{"type":46,"tag":152,"props":939,"children":940},{},[941],{"type":52,"value":942},"Building final native binaries and XCFrameworks",{"type":46,"tag":152,"props":944,"children":945},{},[946],{"type":46,"tag":181,"props":947,"children":950},{"href":948,"rel":949},"https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fmultiplatform\u002Fmultiplatform-build-native-binaries.html",[881],[951],{"type":52,"value":948},{"type":46,"tag":125,"props":953,"children":954},{},[955,960],{"type":46,"tag":152,"props":956,"children":957},{},[958],{"type":52,"value":959},"Kotlin\u002FNative binary options",{"type":46,"tag":152,"props":961,"children":962},{},[963],{"type":46,"tag":181,"props":964,"children":967},{"href":965,"rel":966},"https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fnative-binary-options.html",[881],[968],{"type":52,"value":965},{"type":46,"tag":125,"props":970,"children":971},{},[972,977],{"type":46,"tag":152,"props":973,"children":974},{},[975],{"type":52,"value":976},"KSP with Kotlin Multiplatform",{"type":46,"tag":152,"props":978,"children":979},{},[980],{"type":46,"tag":181,"props":981,"children":984},{"href":982,"rel":983},"https:\u002F\u002Fkotlinlang.org\u002Fdocs\u002Fksp-multiplatform.html",[881],[985],{"type":52,"value":982},{"type":46,"tag":987,"props":988,"children":989},"style",{},[990],{"type":52,"value":991},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":993,"total":1081},[994,1014,1029,1043,1061,1074],{"slug":995,"name":995,"fn":996,"description":997,"org":998,"tags":999,"stars":23,"repoUrl":24,"updatedAt":1013},"kotlin-backend-jpa-entity-mapping","map JPA entities in Kotlin backend apps","Model Kotlin persistence code correctly for Spring Data JPA and Hibernate. Covers entity design, identity and equality, uniqueness constraints, relationships, fetch plans, and common ORM (Object-Relational Mapping) traps  specific to Kotlin. Use when creating or reviewing JPA (Java Persistence API)  entities, diagnosing N+1 or LazyInitializationException, placing indexes and  uniqueness rules, or preventing Kotlin-specific bugs such as data class  entities and broken equals\u002FhashCode.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1000,1003,1006,1009,1010],{"name":1001,"slug":1002,"type":15},"Backend","backend",{"name":1004,"slug":1005,"type":15},"Data Modeling","data-modeling",{"name":1007,"slug":1008,"type":15},"Database","database",{"name":9,"slug":8,"type":15},{"name":1011,"slug":1012,"type":15},"ORM","orm","2026-04-06T18:26:01.44065",{"slug":1015,"name":1015,"fn":1016,"description":1017,"org":1018,"tags":1019,"stars":23,"repoUrl":24,"updatedAt":1028},"kotlin-tooling-agp9-migration","migrate KMP projects to AGP 9.0","Migrates Kotlin Multiplatform (KMP) projects to Android Gradle Plugin 9.0+. Handles plugin replacement (com.android.kotlin.multiplatform.library), module splitting, DSL migration, and the new default project structure. Use when upgrading AGP, when build fails due to KMP+AGP incompatibility, or when the user mentions AGP 9.0, android multiplatform plugin, KMP migration, or com.android.kotlin.multiplatform.library.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1020,1023,1024,1027],{"name":1021,"slug":1022,"type":15},"Android","android",{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},"Migration","migration",{"name":21,"slug":22,"type":15},"2026-04-06T18:25:58.945632",{"slug":1030,"name":1030,"fn":1031,"description":1032,"org":1033,"tags":1034,"stars":23,"repoUrl":24,"updatedAt":1042},"kotlin-tooling-cocoapods-spm-migration","migrate KMP projects from CocoaPods to SPM","Migrate KMP projects from CocoaPods (kotlin(\"native.cocoapods\")) to Swift Package Manager (swiftPMDependencies DSL) — replaces pod() with swiftPackage(), transforms cocoapods.* imports to swiftPMImport.*, and reconfigures the Xcode project.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1035,1036,1037,1038,1039],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},{"name":21,"slug":22,"type":15},{"name":1040,"slug":1041,"type":15},"Swift","swift","2026-04-06T18:25:57.691016",{"slug":1044,"name":1044,"fn":1045,"description":1046,"org":1047,"tags":1048,"stars":23,"repoUrl":24,"updatedAt":1060},"kotlin-tooling-immutable-collections-0-5-x-migration","migrate Kotlin projects to immutable collections 0.5.x","Migrate Kotlin (and Java) code from kotlinx.collections.immutable 0.3.x \u002F 0.4.x to the latest 0.5.x. The 0.5.x line renames every copy-returning method on PersistentList \u002F PersistentMap \u002F PersistentSet \u002F PersistentCollection to a participial form per KEEP-0459 (add→adding, removeAt→removingAt, set→replacingAt, put→putting, clear→cleared, …) and deprecates the old names (WARNING, with ReplaceWith). Driven by the compiler: bump the version, recompile, and apply the rename each deprecation warning names. Use when the user mentions kotlinx.collections.immutable 0.5.x, PersistentList migration, \"Use adding() instead\", KEEP-0459, or sees deprecation warnings from kotlinx.collections.immutable.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1049,1052,1055,1056,1057],{"name":1050,"slug":1051,"type":15},"Engineering","engineering",{"name":1053,"slug":1054,"type":15},"Java","java",{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},{"name":1058,"slug":1059,"type":15},"Tech Debt","tech-debt","2026-06-09T07:19:44.883299",{"slug":1062,"name":1062,"fn":1063,"description":1064,"org":1065,"tags":1066,"stars":23,"repoUrl":24,"updatedAt":1073},"kotlin-tooling-java-to-kotlin","convert Java code to idiomatic Kotlin","Use when converting Java source files to idiomatic Kotlin, when user mentions \"java to kotlin\", \"j2k\", \"convert java\", \"migrate java to kotlin\", or when working with .java files that need to become .kt files. Handles framework-aware conversion for Spring, Lombok, Hibernate, Jackson, Micronaut, Quarkus, Dagger\u002FHilt, RxJava, JUnit, Guice, Retrofit, and Mockito.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1067,1070,1071,1072],{"name":1068,"slug":1069,"type":15},"Code Analysis","code-analysis",{"name":1053,"slug":1054,"type":15},{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},"2026-04-06T18:26:00.191761",{"slug":4,"name":4,"fn":5,"description":6,"org":1075,"tags":1076,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1077,1078,1079,1080],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":13,"slug":14,"type":15},6,{"items":1083,"total":1081},[1084,1092,1099,1107,1115,1122],{"slug":995,"name":995,"fn":996,"description":997,"org":1085,"tags":1086,"stars":23,"repoUrl":24,"updatedAt":1013},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1087,1088,1089,1090,1091],{"name":1001,"slug":1002,"type":15},{"name":1004,"slug":1005,"type":15},{"name":1007,"slug":1008,"type":15},{"name":9,"slug":8,"type":15},{"name":1011,"slug":1012,"type":15},{"slug":1015,"name":1015,"fn":1016,"description":1017,"org":1093,"tags":1094,"stars":23,"repoUrl":24,"updatedAt":1028},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1095,1096,1097,1098],{"name":1021,"slug":1022,"type":15},{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},{"name":21,"slug":22,"type":15},{"slug":1030,"name":1030,"fn":1031,"description":1032,"org":1100,"tags":1101,"stars":23,"repoUrl":24,"updatedAt":1042},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1102,1103,1104,1105,1106],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},{"name":21,"slug":22,"type":15},{"name":1040,"slug":1041,"type":15},{"slug":1044,"name":1044,"fn":1045,"description":1046,"org":1108,"tags":1109,"stars":23,"repoUrl":24,"updatedAt":1060},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1110,1111,1112,1113,1114],{"name":1050,"slug":1051,"type":15},{"name":1053,"slug":1054,"type":15},{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},{"name":1058,"slug":1059,"type":15},{"slug":1062,"name":1062,"fn":1063,"description":1064,"org":1116,"tags":1117,"stars":23,"repoUrl":24,"updatedAt":1073},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1118,1119,1120,1121],{"name":1068,"slug":1069,"type":15},{"name":1053,"slug":1054,"type":15},{"name":9,"slug":8,"type":15},{"name":1025,"slug":1026,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":1123,"tags":1124,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1125,1126,1127,1128],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":13,"slug":14,"type":15}]