Am I imagining things, or does the new IR compiler...
# javascript
s
Am I imagining things, or does the new IR compiler compile much slower?
t
x1.5
in my cases
Legacy -
3m 34s
IR -
5m 13s
b
Depends on workload, actually, it’s hard to make a fair comparison. The biggest difference between compiler backends is that IR compiler backend does the most of work at last stage -- generating executable, it’s required to get smaller outputs. Another compiler backend distributes works between parts, so it needs to generate code only for a current module/project.
When we fairly compared backends last time IR was slightly faster, but the real world isn’t fair 🙂
Anyway, we are going to continue working on performance on real projects when using the new compiler backend.
It would be nice if you could also measure and share with us build time with
-Xir-dce-driven
option. And please make sure you use
clean build
,
t
-Xir-dce-driven
- how can I check if it works?
s
I’m less concerned with clean build, and more concerned with incremental compile times. I’ve tried some simple, apps with the IR compiler, and I’ve noticed that every time I compile, it takes longer than expected
I’m assuming the IR compiler is just new, and that it will get significantly faster over time.
b
Incremental compilation for the IR compiler is not fully ready yet. It’s enabled only for part of pipeline.
@turansky
Copy code
...
js {
...
  compilations["main"].kotlinOptions {
      freeCompilerArgs += "-Xir-dce-driven"
  }
...
}
t
@bashor I mean in result js file
b
@turansky I’d expect that the size of output is the same as from prod build, but content could be slightly different.
s
Incremental compilation for the IR compiler is not fully ready yet
That’s why I’m noticing the big difference in compile times then. Thanks
@bashor I’m assuming that the IR compiler is at least partially shared between jvm, js, and native. That’s the case, right?
b
@spierce7 right, IR compiler backends (native, new js, new jvm) share a lot of code.