PlummersSoftwareLLC / Primes

Prime Number Projects in C#/C++/Python
https://plummerssoftwarellc.github.io/PrimeView/
2.44k stars 575 forks source link

update C# solutions to dotnet 7 #904

Closed qrzychu closed 1 year ago

qrzychu commented 1 year ago

Description

dotnet 7 made big improvements to performance, so just changing the target framework makes 10-30% difference on my machine

rbergen commented 1 year ago

@qrzychu To be honest, I'm curious how you tested this in the Docker context. When I try to docker build your updated solution_1, this is what I get:

~/source/Primes/PrimeCSharp/solution_1$ docker build -t csharp1-pr904 .
Sending build context to Docker daemon  311.8kB
Step 1/11 : FROM mcr.microsoft.com/dotnet/sdk:7.0-focal AS build
manifest for mcr.microsoft.com/dotnet/sdk:7.0-focal not found: manifest unknown: manifest tagged by "7.0-focal" is not found
qrzychu commented 1 year ago

@rbergen sorry for that, fixed

rbergen commented 1 year ago

Thanks for the new commit, that did indeed fix the Docker builds.

I've tested the old and new solutions, and I'd say .NET 7 yields a meaningful improvement to the performance of most implementations. The exceptions are the "stride" implementations in solution 4, where I would call the difference statistically insignificant.

All in all, personally I'm fine with merging this.

@Kinematics @davepl @tannergooding @ItalyToast, do you have any objections to upgrading your respective solution to .NET 7?

tannergooding commented 1 year ago

No concerns on my end. Updating to the latest versions will generally provide some amount of performance wins and will keep the projects on supported versions of .NET

Kinematics commented 1 year ago

Checking it over, it looks like a nice improvement on almost all methods, and no regressions. I don't mind it being updated.

ItalyToast commented 1 year ago

I dont mind it being updated.

rbergen commented 1 year ago

@tannergooding @Kinematics @ItalyToast Thank you for your response. I'm comfortable saying that Dave also won't mind, so I'll proceed with merging.