Wednesday, September 13, 2023

.Net Framework v/s .Net - One more performance comparison

Some of us might have heard why I should upgrade to .Net from legacy .Net Framework as it works and I want to run the application only on Windows servers. We as developers reply to them that .Net is modern and getting a lot of new features etc. Along with we emphasize that .Net is faster than .Net Framework. Should we use Linux to get that performance boost or will it be faster in Windows? There are a lot of comparisons¹ available on the net regarding the same. Here is one more comparison.

Application use case

This post is not to create a log of use cases and compare performance between the 2 frameworks. Rather this is comparing the encryption performance.
The application encrypts and decrypts data using X509Certificate. The use case tested may not be applicable in many projects but this is a solution to send data securely between the producers and one consumer. All the producers have the public key to encrypt and the consumer has the private key to decrypt.


This has projects that consume the shared code with minimal conditional compilations. Those are console apps and are ready to run with the required frameworks installed.

Please create an issue or give a PR if anyone finds problems in the test code.

Test environment

Model - HP EliteBook 840 G3
OS - Win 10 21H2 (OS Buid 19044.2194)
CPU - Intel i7-6600U @ 2.60Hz
RAM - 16GB
.Net Framework Version - 4.8(Runtime v4.0.30319)
.Net Version - .Net 6 (6.0.16)

Results

The .Net performs twice the speed of the .Net Framework. The picture is worth 1,000 words

The results were taken from an average of 3 attempts.

References


No comments: