This article is a continuation of the series (Migration from .NET Core 2.2 to .NET Core 3.1 and How to Migrate a Project From ASP.NET MVC to ASP.NET Core) on upgrading the nopCommerce project – a free .net eCommerce CMS with an open-source code for creating online stores. We will discuss why we continuously strive to upgrade our application’s platform. Here we tell you what we achieved with migration to .NET 6 in terms of performance and try to evaluate our results practically.
The Reasons for Migration
Those who monitor the nopCommerce upgrades know that we do our best to upgrade the application core as promptly as possible. This is facilitated by the continuously evolving Microsoft technologies reflected in the .NET Core platform.
One of the primary objectives is the switch to long-term support (LTS) release. This is because the current .NET 5 version is to be supported and debugged for 1.5 years from its release date. The upgraded nopCommerce 4.50 version is already based on the .NET 6 platform with 3-year support; crucial for the end-users. It will, in turn, provide the community with sufficient time to update their stores and the plugins for them. That being said, expectations of the following version will be accompanied by regular upgrades, including security ones.
With the .NET 6 release, Microsoft developers have brought .NET the closest to being a single platform for developing all the application types present, starting with desktop and web applications, and ending with mobile apps development. Such a unification allows us to release a mobile application for nopCommerce in a single C# codebase. This will undoubtedly benefit our developer community in terms of immersion and understanding the entire nopCommerce ecosystem.
Also, we planned to raise the performance bar of our application with the switch to .NET 6. Going ahead, the measurement results revealed some interesting data regarding the nopCommerce evolution, and we would like to share them.
.NET 6 Performance Benchmarks in the Application
To measure load and scalability, we chose a quite popular SaaS service, loader.io, as the test tool. An average machine for development was used as the server with the deployed application:
CPU – Intel(R) Core(TM) i5-7400 CPU 3.00 GHz
RAM – 16.0 GB
The tests were managed using Windows 10 (19044.1415) and IIS 10 (10.0.19041.1415). We also used a standard database provided at the application setup. All of which were managed using MS SQL Server 2019 (19.0.2000).
To simulate the load, we chose the test configuration that would connect 250 users during a minute. The users would visit a few random application pages. These would be sufficient to provide the general picture of the platform’s response and visualize the difference relative to the previous versions.
Further, I will present the correspondence table with the nopCommerce application and .NET platform versions.
| nopCommerce | 4.30 | 4.40.4 | 4.50 |
| .NET | .NET Core 3.1 | .NET 5 | .NET 6 |
We carried out 3 consecutive load tests to gain insights into the load nature and memory consumption on the server. The average results from several runs are given below.
Response time measurement (the less, the better). There is an evident trend in performance improvement compared to .NET 5 and .NET Core 3.1 versions: 46.1% and 65.3%, respectively.
Measurement of the memory usage by the application (the less, the better). The tests were run in succession for each platform without resetting the application pool. It should be considered that the .NET platform’s memory overhead has increased; this is apparently the inevitable cost of the enhanced performance. However, we must note that the optimization promised in .NET 6 can be seen here.
.NET 6 vs .NET 5: Load Distribution
Let’s now consider the load distribution in the nopCommerce platform with .NET 6 in detail. We will then compare it with the same test data for .NET 5. Importantly, here, we show the general trend for the system when working on different platforms rather than reveal the limit values at which the system would go off balance because this is largely dependent on the technical data of the server under test.
Load distribution in .NET 6
Load distribution in .NET 5
Analyzing this, we can see an interesting pattern from the .NET 6 benchmarks: with an increasing number of clients per second, the average response time in the plot maintains a sufficient distance from that of .NET 5. The upgraded version’s curve is smoother and has fewer bursts. Another good indicator is that the curves don’t cross each other during the entire test. This is indirect evidence of the enhanced performance. .NET 6 handles the test more easily than .NET 5 does.
Once again, we have confirmed that following Microsoft’s latest technological advances is beneficial. Apart from improved performance, we got an upgraded platform that will allow us to move in a new direction: the mobile application. We started heading back to the mobile application in version 4.40 by implementing Web API that covers literally all the functions provided by our platform. We have slightly more memory overhead in favor of performance improvement: this should be considered when choosing the hosting provider. However, since the current version will be dominant among the others in our community in the mid-term, switching to it seems the most practical solution.
First published here
Read more: hackernoon.com