Unleashing Parallel Processing in Your F# Compiler


Hey there, let’s cut to the chase: the dotnet 7.0.400 SDK release brings some feature flags that can turbocharge your F# compiler.
In this post, I’m shining a spotlight on three of these gems that you absolutely need to give a spin.


First things first, you need the latest SDK (7.0.400 and beyond). Then, let’s tweak some <OtherFlags> to fine-tune the F# compiler in MSBuild.
Just drop this snippet into your *.fsproj or Directory.Build.props file:

<OtherFlags>$(OtherFlags) --test:GraphBasedChecking --test:ParallelOptimization --test:ParallelIlxGen</OtherFlags>


Want to double-check if it’s working? Run dotnet build --no-incremental -v n and spot the extra compiler flags in CoreCompile:

C:\Program Files\dotnet\dotnet.exe "C:\Program Files\dotnet\sdk\7.0.400\FSharp\fsc.dll" -o:obj\Debug\netstandard2.0\YourProject.dll

But what magic do these flags weave, you ask? They sprinkle their fairy dust over the various phases of F# compilation.
Now, let’s keep it breezy on the technical stuff:

It’s a kinda magic, that’s what! ✨🎩


Big shout-out to Janusz Wrobel and Tomas Grosup – these rockstars took the compiler to new heights! Their skills and hustle are seriously awe-inspiring. As for me, well, let’s just say I added my own sprinkle of magic to the mix. Teamwork at its finest, folks! 🚀🌟

Closing thoughts

You really need to try out these flags!
Otherwise there is no way of telling if this can ever become the default in dotnet 8!

Clear enough I hope 😸.