The Crystal Programming Language Forum

Could new LLVM pass manager improve compile times?

Looks like LLVM 13’s new pass manager has been improving compilation times in Rust:

Is it possible it could do the same for Crystal?

1 Like

Probably, but only for release mode. The pass manager is not used in no-release mode.

Looks like mostly a large programs would benefit from it

However, smaller applications with tiny hotspots likely won’t see much benefit from the new PM since the improvements brought on by the new PM tend to be more relevant to large codebases.

Ah, good point. I didn’t catch that. Thanks!

Large programs are the ones that need the most help on this front, but I wonder what constitutes “large” there. It’d be interesting to know what the curve looks like.

If compilation speed is a no go decision at some point (some large program) then extra 5-20% performance probably won’t change anything. Orders of magnitude improvement would.

Eh, 5-20% just for enabling a flag or whatever it is that is required sounds amazing. Especially as it also is more powerful and allow more code to be optimized.

And remember that performance improvements compound - stack enough small improvements on top of each other and it ends up noticeable.


This is 100% where I was going with the question. It wasn’t about compilation speed being make-or-break. Improvements are small more often than not, so if we hold out for the huge breakthroughs, we’re going to miss a lot of small improvements along the way.


I’d be more-so interested in this and see what kind of extra optimizations it would be able to do performance wise. From what I can tell being able to revisit things as more information is learned could prove quite beneficial.

1 Like