Migration from .NET5 to .NET 6

an introduction

This post continues our series of articles (Migrating from .NET Core 2.2 to .NET Core 3.1 and How to Migrate a Project from ASP.NET MVC to ASP.NET Core) about upgrading a nopCommerce project – a free content management system. Open source code for creating online stores. This article discusses why we are constantly striving to upgrade our app platform.

Here we tell you what we achieved by moving to .NET 6 in terms of performance and try to evaluate our results in action.

Reasons for emigration

Those who keep an eye on nopCommerce upgrades know full well that we do our best to upgrade the core of the app as quickly as possible. This is facilitated by the ever-evolving Microsoft technologies that are reflected in the .NET Core platform.

One of the primary goals is to switch to the Long Term Support (LTS) version. This is because the current version of .NET 5 will be supported and debugged for 1.5 years since the release date. The upgraded nopCommerce 4.50 is already based on the .NET 6 platform with 3 years of support, which is critical for end users and will give the community enough time to update their stores and plugins. However, expectations for the next release will be accompanied by regular upgrades, including security upgrades.

.NET Annual Promotions

With the release of .NET 6, Microsoft developers have brought .NET closely to the single platform for developing all kinds of existing applications, from desktop and web applications, to mobile application development. This standardization allows us to launch a nopCommerce mobile application in a single C# code base, which will undoubtedly benefit our developer community in terms of immersion and understanding of the entire nopCommerce platform.

Also, we planned to upgrade the performance of our app with the switch to .NET 6. Going forward, the benchmarking results revealed some interesting data regarding the evolution of nopCommerce, which we’d like to share.

NET 6 Performance Benchmarks in the app

To measure load and scalability, we chose a very popular SaaS service, Load.io, as a testing tool. An average machine was used for development as a server with the published application:

  • CPU – Intel (R) Core (TM) i5-7400 CPU 3.00 GHz
  • RAM – 16.0 GB

Tests were administered using Windows 10 (19044.1415) and IIS 10 (10.0.19041.1415). We used a standard database provided when preparing the application. All of these were managed using MS SQL Server 2019 (19.0.2000).

To simulate the loading, we chose the trial configuration that would connect 250 users within 1 minute. Users will visit some random app pages. These will be sufficient to provide the overall picture of the platform’s response and visualize the difference relative to 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

.Clear

NET Core 3.1

NET 5

NET 6

We ran 3 consecutive load tests to gain insight into the nature of loading and memory consumption on the server. Average results from several runs are given below.

Measure response time (the lower, the better). There is a clear trend in performance improvement compared to .NET 5 and .NET Core 3.1 versions: 46.1% and 65.3%, respectively.

Average runtime results

Measuring memory usage by the application (the less, the better). The tests ran sequentially for each platform without resetting the application pool. It should be borne in mind that the memory overhead of the .NET platform has increased; This appears to be the inevitable cost of improved performance. However, we should note that the promised improvement in .NET 6 can be seen here.

The results of memory usage by the application

NET 6 vs. .NET 5: Download Distribution

Let’s now consider the load distribution of the nopCommerce platform with .NET 6 in detail and compare it with the same test data for .NET 5. More importantly, we show the general trend of the system running on different platforms rather than revealing the boundary values ​​at which the system will disappear because it depends To a large extent on the technical data of the server under test.

Download distribution in .NET 6:

Download distribution in .NET 6

Load distribution in .NET 5:

Load distribution in .NET 5

Analyzing this, we can see an interesting pattern from the .NET 6 standards: as the number of clients per second increases, the average response time in the scheme keeps a sufficient distance from .NET 5. The upgraded version curve is smoother and has bursts Less motorcycles. Another good indication is that the curves do not intersect each other during the entire test. This is indirect evidence of improved performance. .NET 6 handles testing more easily than .NET 5.

Abstract

Once again, we have made sure that following the latest technological developments by Microsoft is beneficial. Apart from the improved performance, we got an upgraded platform that will allow us to move in a new direction. This is, of course, the mobile app: something we started back in version 4.40 with a Web API that covers literally all the functionality our platform offers.

We have a bit more memory in favor of better performance: this should be taken into account when choosing a hosting provider. However, since the current version will be dominant among others in our community in the medium term, switching to it seems the most practical solution.

Learn more about our project at nopcommerce.com or visit our GitHub repository

.

Leave a Comment