New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance anomalies in comparsion to Mono #13425
Comments
|
@nxrighthere have you tested Mono-LLVM-JIT (.NET 5 runtime) by the way? 🙂 with recent changes it supports "fast-math" and all Math(F) methods are @llvm.intrinsics (let me know if you need any help to setup it) |
|
Looking at the tests, you may need to do 30+ iterations of the methods for .NET Core 3.0 prior to doing the measurement to allow tiered compilation to kick in. |
|
@EgorBo Thanks for the suggestion, going to try to play with it for sure. 👍 |
|
Also, it seems you use stackalloc a lot - it probably makes sense to clear |
|
@benaadams I've tried .NET Core 3.0.100-preview9 and engage tiered compilation through heavy iterations, but results are almost the same, unfortunately. 😢 @EgorBo Interesting, I've never heard before about |
|
@dotnet/jit-contrib |
|
@nxrighthere Have you tried disabling tiered compilation ( Have you seen https://github.com/dotnet/performance? Maybe you should consider contributing the benchmarks to that set, to be run regularly on .NET? |
|
@BruceForstall Indeed,
I was not aware of this repository, will consider contributing directly into it, thank you. Should I close this issue or keep it open? |
|
@nxrighthere Your linked repo mentions ".NET Core 2.2.402". Have you tried with the latest .NET Core 3.0 build to see if there is any difference? We're always looking for good benchmarks to use for performance comparison. It looks like you've found some where there are perf gaps between RyuJIT and other options that could be investigated.
Seems reasonable to keep it open for now. |
|
@BruceForstall Here's the diff with results for 3.0.100-rc1. There's only one noticeable difference: recursive Fibonacci is slower by 22% with the new version, all other tests remain with near the same numbers. |
|
@EgorBo I'm a bit lost with Mono's LLVM. The 6.0.0.334 version on the website is able to compile the code with |
|
@nxrighthere |
|
@EgorBo Hey Egor, it's possible to build the runtime with LLVM JIT from master on Windows right now? |
|
Looks like we never drilled in to understand why Core is slower -- seems like we ought to do so, there may be one or two things there we can address without needing entire new classes of optimization. |
|
Well, in general, it's all fine right now except places where floating-point arithmetic is involved, since as far as I know there's no equivalent to |
|
Is there some writeup you can point me at with more details? |
|
Related issue #12753 |
|
Thanks. I was actually looking for analysis showing that fast fp is the root cause of the perf differences in Core vs Mono-LLVM. I suspect there's more going on than just that... |
|
@AndyAyersMS I think one of the low hanging fruits is a*b+c to fma recognition. |
|
@nxrighthere we are still moving things here and there but it's already possible for macOS and Linux: then go to After that you should see |
|
After upgrading to .NET 5 Preview 8, I noticed a significant regression in this recursive Fibonacci test. Execution is slower by 40% vs .NET Core 3.1.101 while in other tests .NET 5 shows better results. |
|
If you're talking about a regression in CoreCLR perf, it's likely because of #35020. |

Recently I made a bunch of various benchmarks to test Unity's Burst compiler against native compilers. I've also included Mono and CoreCLR out of curiosity, the code is available here in .NET folder. I've noticed strange results in two tests (Sieve of Eratosthenes and Particle Kinematics) where CoreCLR performs way much slower than Mono for some reason, I think this requires in-depth analysis by appropriate developers of .NET Core.
I'm happy to provide any additional info or assistance if required.
category:cq
theme:needs-triage
skill-level:expert
cost:medium
The text was updated successfully, but these errors were encountered: