.NET 7 slower than .NET 6?
-
Has anyone found that? Just tried upgrading a hand-rolled ML console application from .NET 6 to .NET 7 and found it was slower. In my example it went from 0.55s to 0.7s. Tried this several times in each case. Previously, the time had almost halved in going from .NET 4.8 to 6.0. I'm not using any packages. :confused:
Kevin
-
Has anyone found that? Just tried upgrading a hand-rolled ML console application from .NET 6 to .NET 7 and found it was slower. In my example it went from 0.55s to 0.7s. Tried this several times in each case. Previously, the time had almost halved in going from .NET 4.8 to 6.0. I'm not using any packages. :confused:
Kevin
If you want to learn more, add stopwatches to see which "parts" are slower. Startup? Shutdown? Something else? What's the footprint? Debug versus release?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Has anyone found that? Just tried upgrading a hand-rolled ML console application from .NET 6 to .NET 7 and found it was slower. In my example it went from 0.55s to 0.7s. Tried this several times in each case. Previously, the time had almost halved in going from .NET 4.8 to 6.0. I'm not using any packages. :confused:
Kevin
It shouldn't be slower. I'd suggest reporting the problem on the .NET GitHub repo[^], along with the simplest reproduction of the problem you can get, and the relevant benchmarks from .NET 6 and 7.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
If you want to learn more, add stopwatches to see which "parts" are slower. Startup? Shutdown? Something else? What's the footprint? Debug versus release?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
Gerry Schmitz wrote:
What's the footprint? Debug versus release?
Release vs Release vs Release. No code changes apart from using top-level statements when I went from .NET 4.8 to .NET 6. This is just a sample from a book. Not important, but just curious as it defied my expectations.
Kevin
-
It shouldn't be slower. I'd suggest reporting the problem on the .NET GitHub repo[^], along with the simplest reproduction of the problem you can get, and the relevant benchmarks from .NET 6 and 7.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Reported issue. They suggested running from console with DOTNET_TC_QuickJitForLoops=0 env var defined. That speeds it up slightly, although 6.0 is still a bit faster. I read somewhere that in 6.0, setting that to 0 speeds things up but that in .NET 7 there's no difference. Though to me it looks like it might be the other way round! So for 6.0 I get 0.53/0.54s (two successive runs). For 7.0 it is 0.57/0.58s. Still, nothing worth bothering about.
Kevin