Videos
Which framework, .NET Core or Go, is better for building high-performance applications?
Can I achieve comparable performance with both .NET Core and Go?
What are the key factors to consider when selecting between .NET Core and Go for high-performance applications?
HiI am a node devBut aiming to consider ASP>NET core vs GO for a backend web app .I read an opposite results of benchmarks.I know that GO yields binary while C# yiels byte codeBut this is not the only thing that affects performance.which is more performant between both for heavy load apps?
does go add Generics till now ?
Heyas,
I wanted to know which framework to consider more seriously for a new backend, but seemed a lot of benchmarks were outdated, so I wrote one today, and I'll be honest: I haven't used either of these frameworks/technologies much at all in any recent years (Go minimally, and I used to be a .NET programmer around 2005).
Anyway, I'm not entirely sure if this test is completely fair or accurate, but I tried to match the code approach for each as closely as possible. For instance, there has been a lot of rave about .NET Core and its performance, but it seems to be waaaay slower than Go. Can anyone with some proficiency in .NET Core (Web APIs) take a quick look at the source code and see if I'm doing something completely wrong here? Is this possibly because .NET Core 5.0 is in RC (I tested both development and production builds), or because I'm running it on a Mac (it's "cross-platform", isn't it? ;p)?
I will probably add some other results to this benchmark soon, for instance .NET Core 3.0 (Stable), and also would like to test Java (with Spring Boot) against them, maybe Rust. I will also add some other concurrencies/max requests once I've confirmed the source code is on par with each other.
If anyone has any suggestions to modify the benchmark, or has questions on setting it up on their own platform, feel free to reply.
Update: Added JSON-only test to avoid hitting the DB/using any DB driver.
Update: Added Rust (actix-web framework) JSON-only test.
Source Code and Results:
https://github.com/rw3iss/Go-vs-.NETCore-5-Benchmark/
TL;DR:
Go (POST - Db Write):
Requests per second: 7475.72 [#/sec] (mean)
Go (GET - Db Read):
Requests per second: 8454.86 [#/sec] (mean)
Go (GET - JSON Only):
Requests per second: 34946.10 [#/sec] (mean)
.NET Core 5.0 RC (production build) (POST - Db Write):
Requests per second: 742.30 [#/sec] (mean)
.NET Core 5.0 RC (production build) (GET - Db Read):
Requests per second: 1172.63 [#/sec] (mean)
.NET Core 5.0 RC (production build) (GET - JSON Only):
Requests per second: 1488.64 [#/sec] (mean)
Update:
I've added a simple Rust - JSON Only read test to do a basic comparison:
Rust 1.42 (actix-web v3) (GET - JSON Only):
Requests per second: 15039.15 [#/sec] (mean)
This is very interesting, but there's a danger that your benchmark is actually comparing the performance of the respective database connectors rather than Go vs .NET.
Would be interesting to see some different benchmarks.
Perhaps one where each end point just returns a hard coded string (Eg "hello world"). This would measure the performance of the respective http stacks.
Another might be where the end points do some kind of cpu intensive calculation. Although it's not the best benchmark, a simple loop counting to say a million would be super-easy to implement and gives you a very crude indicator of relative performance. (I'm aware of how flawed this is as a proper benchmark though)
If you need exausive benchmarks:
https://www.techempower.com/benchmarks/
There are a lot of infos of about how and why benchmarks have been implemented and what they are actually testing.
Nevertheless, you often might like to have a look into the benchmark implementation for your preferred language in order to make a informed decision of "how" its done (like ORM vs. "Plain" filtering for example).