Very slow build speeds for hello world

Note: on UNIX (and thus WSL) we can use fork to do the LLVM codegen in multiple processes, which we obviously can’t on Windows. This can explain some (maybe most?) of the “slower to compile on windows” behavior (check with crystal build --stats).

I tried to use threads instead of fork but I hit LLVM thread safety issues :sob:

An alternative would be add a crystal codegen command instead of forking, and to stream the LLVM IR from the main process to the codegen processes (similar to how its done in MT). That would be Windows compatible.

4 Likes