-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
There is a whole suite in which .NET Core runs in 0.02 times the time that mono takes to run the suite. This suite is the PerfLabTests
- .NET Core takes
101130.602 ns - Mono with AOT takes
4520483.984 ns - Mono's JIT with LLVM takes
3938013.177 nsto run (warmed-up) code
The benchmark is GetMethod from the GetMethod harness.
I have extracted the relevant types into a standalone executable reproduction here
https://gist.github.com/alexanderkyte/2a49ceb411ec5554e3ea612fec747ca2
OSX's Instruments tool seems to suggest that the slowdown lies in repeated calls to mono_class_get_methods_by_name without caching, including what appears to be an expensive series of calls to mono_class_get_methods.
I think that .NET Core is probably doing a number of complex things to get their running time down, but it also looks like the biggest contributors to our running time are a couple of bits of low-hanging fruit.