Performance on macOS vs Windows (.net v6 console application, C# v9) #76797
Unanswered
PlunderBunny
asked this question in
Q&A
Replies: 3 comments 8 replies
-
Console output benchmarks? Doubt that this is any important thing. Filling a console is NOT usable and does not make sense for a benchmark at all. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Do you actually mean |
Beta Was this translation helpful? Give feedback.
4 replies
-
You will also find the performance can be largely different among different terminals even in the same OS. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all.
I have run up against an interesting performance issue when comparing the exact same .net code in Windows and macOS. I don't understand why there's such a significant performance difference, and I'm not sure of the best way to proceed.
The code is for a .net (v6) console application (C# v9) that I've been developing on macOS using Visual Studio for Mac. The program performs acceptably on macOS. When I copy the code to my Windows VM and re-compile in Visual Studio 2022, I find that the performance is quite poor - unusably so.
I did some simple performance investigations using the Stopwatch class, beginning with the method that writes to the console window: I determined this was more than 150x slower on Windows than macOS - please see my SO post that includes a minimal reproducible example and more detail.
I then looked at some other parts of the application, and it appears that performance under Windows is slower than macOS even for code that consists of in-memory (i.e. no I/O) calculations only. For example, my routine to determine what the player can see executes at-least 10x slower on Windows than on macOS. I emphasise that this is exactly the same code, with both versions built on up-to-date Microsoft compilers.
It's as-if the Windows version of the application is being throttled (I don't mean that in a nefarious way). A release version behaves similarly. Is this a recognised issue, and if so, is there a work-around? I know almost nothing about the more technical aspects of the .net runtime, so I'd really appreciate a simplified explanation.
Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions