Kotlin JS IR slow build time

I recently switched a fairly large JS project to use the IR compiler. I also enabled incremental compilation.

A cold build takes more than 3 minutes. Small changes may take anything from 40s to 3 min (most commonly over 1.5 mins). I made a few changes and switched it back to Legacy for comparison and it takes only 1 min for a cold build and around 20 seconds for modifications. Unfortunately it is a private project I can’t share but I was wondering if there is some general approaches to make Kotlin JS using IR to build faster.

I was under the impression that under IR I should be expecting things to build faster, not that much slower.
The vast majority of the slowness comes from the compileKotlinJs task with 15 seconds or so coming from webpack tasks. I’m using kotlin 1.6.21

2 Likes

Apparently problem has been reported here https://youtrack.jetbrains.com/issue/KT-51712