Unity's Mono problem: Why your C# code runs slower than it should
* Unity uses Mono, a legacy JIT runtime → 2–3× slower than modern .NET
* Benchmarks: map generation and game startup take 100s in Unity/Mono, 38s in .NET (Debug mode)
* Even in Release mode: Mono 30s vs .NET 12s
* Mono JIT produces unoptimized machine code, lacks modern runtime features
* CoreCLR promises major speedups + modern APIs, SIMD, hardware intrinsics
* Burst compiler helps, but limited; CoreCLR would unlock broader improvements
To add to the author’s ideas, Editor performance is also a huge benefit, not just runtime. Slow iteration can cost hours per week, making iteration speed crucial for big teams and projects.
Working with LLMs adds another challenge: AI can sometimes break working code while fixing old bugs. Using unit tests to verify existing logic helps, but running them in Unity Test Runner is slow and requires a lot of manual work.
With a great idea from a friend, I created an infrastructure to run unit tests on the latest .NET without using the Unity Editor. This lets AI run the tests by itself to verify its changes, so no manual action is needed, and it takes mere seconds compared to Unity Test Runner.
I haven’t seen any info about this setup online yet, so either me or my friend might prepare a sample and a post describing how to set it up, but that’s still undecided. Drop a 💯 if you are interested
https://marekfiser.com/blog/mono-vs-dot-net-in-unity
#coreclr #performance
Post #2593
1.35K