Skip to content

dotnet build performance - Windows Vs MacOS Vs Linux #48541

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

Open
yngndrw opened this issue Apr 17, 2025 · 0 comments
Open

dotnet build performance - Windows Vs MacOS Vs Linux #48541

yngndrw opened this issue Apr 17, 2025 · 0 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@yngndrw
Copy link

yngndrw commented Apr 17, 2025

We've noticed some unexpected build performance differences Windows, Mac and Linux machines when running dotnet build. (dotnet 8)

We've run the following tests, trying to keep the tests as fair as we reasonably can. All tests were performed via the command line so as not to introduce differences based on the IDE, all other software was closed except a Microsoft Teams video call which was running during every test. All tests used the same codebase and we ignored the first build time. The numbers are approximate as it wasn't a perfect scenario but the differences are large enough to demonstrate the issue. The Linux did not include the Teams video call, unfortunately.

We had three setups: (Sorry I don't have some of the precise details as my colleagues are off today, but the specs are close enough to show the issue. Free memory wasn't an issue during any of the tests. All machines have NVME drives)

  1. A Macbook with an Apple M3 Max processor. I'm not sure if it's a "14" or "16" core processor but either way it has 10-12 performance cores, a TDP of 78W and a 3nm process.
  2. A Windows 11 desktop with an Intel Xeon W5-2445 processor. It's a 10 core processor with a TDP of 175W and a 7nm process.
  3. A Windows 11 laptop with an Intel i7-11800H processor. It's an 8 core processor with a TDP of 45W and a 10nm process.
  4. A Linux desktop with an AMD Ryzen 9 processor. It's a 12 core processor but unfortunately I don't know exactly which one.

I like to use process size and TDP to judge a processor's performance, as that also captures the thermal performance for sustained use without thermal throttling.

From the specs, you might expect #1 and #2 to be approximately in the same ballpark, as the Macbook's lower TDP is made up for by the smaller / more efficient process. You may also expect #3 to be approximately 3-4x slower than #2 when it throttles down.

Command used:
dotnet build Airsweb.sln --no-incremental --no-restore --property WarningLevel=0
We disabled warnings in order to rule out differences in the terminal performance and we disabled package restoration to rule out differences in network performance.

Results:
#1 - Build time was around 35 seconds, with the CPU usage pegged at 100%.
#2 - Build time was around 80 seconds, with the CPU usage pegged at 100% expect for a period during the middle where it dropped to 20%.
#3 - Build time was around 180 seconds, I'm not sure what the CPU usage was like during this test.
#4 - Build time was around 40 seconds, I'm not sure what the CPU usage was like during this test. As a reminder, this one did not include the video call.

Looking at these ballpark numbers:

The tests were not scientific enough to categorically state that there's a problem, but the performance difference between #1 and #2 was really unexpected. Has anybody else had the same experience and by extension, is this an issue with the dotnet build tool that could be resolved, or is this a fundamental difference between the OSs which cannot be resolved, or have I missed something when I set my expectations on this hardware?

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant