To verify absurdly long compilation times(>80 minutes), I tried to check what happens with --timings flag.
The problem happens only with release flag, so probably this is caused by llvm optimizations, but I started to check time baseline with debug build and I found on graph two long image-rs elements - this would be expected if I would compile two different image crate versions, but in Cargo.lock I see only one occurrence of image crate.
Why rust compiles twice the same version of library? Is this maybe a preparation stage and real compilation or maybe a bug?
It looks like the image crate is used both at runtime by your own code and at compile time by i-slint-compiler. As you aren't cross-compiling it would technically be possible to reuse the same image crate, but it doesn't get reused because build dependencies are unconditionally built with optimizations disabled to reduce the time it takes to compile when a dependency is only used at build time, like is the case most of the time. It unfortunately has the side effect of causing compilation to get longer when a dependency is used both at build time and at runtime.
For reference on my system compiling image v0.24.8 + all it's dependencies in release mode on a single efficiency core took a total of 75s. I used a single core to simulate the effect of other crates keeping the rest of the cores busy and used an efficiency core because it has a lower turbo frequency (which wouldn't be reached anyway when compiling other crates at the same time)
Maybe in the debug build compilation was restricted to a single core due to other crates getting compiled, while in the release build it happened to be able to fill some gaps allowing it to use multiple cores for compilation for at least part of the time?
Are you using fat LTO? It seems like it is only using a single core during most of the time compiling krokiet. Fat LTO can only use a single core. Using thin LTO would allow using all cores, which should be several times as fast.