.Net 5 Performance Improvements
-
Hey, A bit backstory: I am working for some time on my Text-Templating engine project Morestachio and all the time i compare the performance of Morestachio against other engines like cottle, handlebars.net, scribain etc and with the latest release of .Net5 i was thrilled as microsoft promised another out-of-the-box performance improvement like the one we saw when net.core came out where each version was measurably faster then the previous one. I read some block posts like this one: [Performance Improvements in .NET 5 | .NET Blog](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/) but when i did my usual performance comparisons I discovered more or less the opposite. I have two performance metrics: Historical performance tests including only Morestachio using Nunit and a project using the BenchmarkDotNet lib. BenchmarkDotNet: .net472:
Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated Bench 2.019 ms 0.0041 ms 0.0036 ms 257.8125 15.6250 - 1.57 MB .NET5:
Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated Bench 2.219 ms 0.0044 ms 0.0039 ms 85.9375 3.9063 - 705.5 KB .NetCore 3.1:
Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated Bench 1.427 ms 0.0035 ms 0.0033 ms 95.7031 5.8594 - 783.67 KB this also performance difference is also present in the other test (i will not bother to post here). Yes Net5 is way more efficient in memory consumption but in comparison slower then even pre NetCore.
-
Hey, A bit backstory: I am working for some time on my Text-Templating engine project Morestachio and all the time i compare the performance of Morestachio against other engines like cottle, handlebars.net, scribain etc and with the latest release of .Net5 i was thrilled as microsoft promised another out-of-the-box performance improvement like the one we saw when net.core came out where each version was measurably faster then the previous one. I read some block posts like this one: [Performance Improvements in .NET 5 | .NET Blog](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/) but when i did my usual performance comparisons I discovered more or less the opposite. I have two performance metrics: Historical performance tests including only Morestachio using Nunit and a project using the BenchmarkDotNet lib. BenchmarkDotNet: .net472:
Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated Bench 2.019 ms 0.0041 ms 0.0036 ms 257.8125 15.6250 - 1.57 MB .NET5:
Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated Bench 2.219 ms 0.0044 ms 0.0039 ms 85.9375 3.9063 - 705.5 KB .NetCore 3.1:
Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated Bench 1.427 ms 0.0035 ms 0.0033 ms 95.7031 5.8594 - 783.67 KB this also performance difference is also present in the other test (i will not bother to post here). Yes Net5 is way more efficient in memory consumption but in comparison slower then even pre NetCore.
If I put bigger or smaller wheels on a car, it will affect it's speed; all other things being equal. Memory and response time is like that. And we have different cars.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food