msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

dotnet 6 build apple m1 max slow

Open last-Programmer opened this issue 3 years ago • 6 comments

When i try to build dotnet 6 console application in m1 max computer it takes longer than that takes on Windows/Linux Computers

Here is the summary build time of dotnet6 console application

Windows : 39 seconds Linux : 33 seconds m1 max arm64: 50 seconds

Not sure what is causing build to be slower in m1 max macs

Any steps to debug the problem?

Thanks in advance

last-Programmer avatar Dec 08 '21 02:12 last-Programmer

I notice this recently too, build same .netcore 3.1 solution, my 5800x hachintosh jsut need up to 12 seconds, but M1 Max Macbook Pro takes up to 48 seconds, also tested on Windows: Thinkpad T14(5850u/32G RAM) with VS 2022, only need up to 16 seconds, may be msbuild is still not native supported

evenlee avatar Aug 29 '22 10:08 evenlee

This is definitely not expected. Would it be possible to share a binary log of your build? ⚠️Note the warnings about the contents of the log and please make sure you're not sharing more than you're comfortable with.

rainersigwald avatar Aug 29 '22 14:08 rainersigwald

I met errors when using dotnet build -bl on Mac , the reason is I have a .net 6 winform app and a .net 4.5 lib project in the solution, the wired thing is when I click build button in VS for Mac, no errors, do you know how to leverage command to make same behavior as build button in VS for Mac

evenlee avatar Aug 30 '22 14:08 evenlee

Hello @evenlee, what error do you see exactly? Also, could you please run dotnet build --version and share the result with us.

AR-May avatar Sep 05 '22 12:09 AR-May

output_from_msbuild_failed_M1Max.log output_from_vs_2022_build_intel_mac.log output_from_vs_2022_build_M1Max.log

dotnet build --version MSBuild version 17.3.0+92e077650 for .NET

As I mentioned, I have a winform project(fix error by adding <EnableWindowsTargeting>true</EnableWindowsTargeting> in project file) and a .Net 4.5 lib project, the error comes from the .NET 4.5 lib project

evenlee avatar Sep 07 '22 13:09 evenlee

I did more testing, seems the issue is the .NETFramework 4.5 lib project, if I remove it and related projects depended on it, the rebuild time is almost same in both M1Max Mac and Intel Mac, but if included it, the M1Max Mac will take too much time, may be you can build .net core project and add a .NET Framework4.5/4.8 Lib project in VS on windows, then rebuild in M1Max Mac for more details.

evenlee avatar Sep 10 '22 04:09 evenlee

This issue is marked as stale because feedback has been requested for 30 days with no response. Please respond within 14 days or this issue will be closed due to inactivity.

ghost avatar Oct 11 '22 00:10 ghost

Team triage: It looks like there are two issues at play here. @last-Programmer reported a general slowdown in dotnet build scenarios, which @AR-May is not able to reproduce. If you're still seeing unexpectedly slow builds on ARM Macs, please share logs or a repro case that builds faster than on Intel.

@evenlee, on the other hand, is seeing slower builds within Visual Studio for Mac when building a .NET Framework 4.5 project that does not use the new .NET SDK. That is a different codepath in Visual Studio for Mac, and we think that issue would best be investigated by the VSMac team. Please file a bug with them at https://docs.microsoft.com/visualstudio/mac/report-a-problem, ideally with a repro case and logs showing the build time differences. You may also be able to get better behavior by converting your project to use the .NET SDK, which can target .NET Framework 4.5.

I'm going to close this bug since we haven't been able to reproduce the originally reported performance issue and the other issue needs investigation by the VSMac folks.

rainersigwald avatar Nov 16 '22 17:11 rainersigwald