DEV Community

Go vs .NET Core in terms of HTTP performance

Gerasimos (Makis) Maropoulos on August 19, 2017

Hello Friends! Lately I’ve heard a lot of discussion around the new .NET Core and its performance especially on web servers. I didn’t want to ...
Collapse
 
manigandham profile image
Mani Gandham • Edited

The .NET compilation mode is different from the environment mode it runs in. Environments are just names and can be set to anything, like "production" or "dev-1234", and then easily checked within the app to load up the appropriate settings (like connection strings) or enable certain features. It's a really nice built-in system for organizing configs and operation.

The compile flag for Release or Debug is used by the compiler to actually build binaries using different settings like optimizing code and including debug symbols. The .NET devs are all telling you about the differences here because you didn't understand it, and adding an arrogant paragraph about it doesn't help your case. (Edit: looks like that paragraph has been removed now).

Regardless, it's fine if you want to show off your web framework but these benchmarks are rarely useful since it's highly unlikely you have anywhere close to the functionality offered by the ASP.NET MVC framework.

Collapse
 
ksejka profile image
Karol Sejka

hey, great post but i think there's need to be more said when it comes to benchmarking. First of all you're not only benchmarking dotnet core. there's also aspnet core and json serializaition library (same with go ofc but i'm feeling like you're picking on perf focus from dotnet team). So basically you're performing "Json serialization" benchmark from techempower techempower.com/benchmarks/#sectio...
While dotnet core and aspnet core have been greatly improved json library hasn't as of right now. so if you want to measure dotnet improvement check out "Plaintext" category. Second thing is features. aspnet core is full fledged mvc framework whereas iris is argubly less feature full. That's said your benchmark methodology info is not enough (what about server gc?) so I'd rather take results from Techempower (i'm not saying go is slower). Thanks!

Collapse
 
joalcava profile image
J. Alejandro Cardona

Sorry but your benchmark says nothing, you are comparing bicicles with motorcicles. I think you'r also insulting the hole dotnet/aspnet core community with such a simplier benchmark that only can confuse people.

Collapse
 
nepooomuk profile image
Robin

"There are not lot of web frameworks for Go with MVC support but, luckily for us Iris does the job."
This is post is sponsored by the creater of Iris. LOL.

Collapse
 
rvprasad profile image
Venkatesh-Prasad Ranganath

Nice post. While performance is a key aspect, I think 27 lines vs 86 lines is also a key aspect. If the extra lines are boiler plate, then it is not an issue as they can be auto generated. If not, then they can easily add to cognition overload, productivity, and maintenance, e.g., when they are semantic rich as in case of web routing info or use of specific annotations.

Collapse
 
lukepuplett profile image
Luke Puplett

Thanks for working on these comparisons, its good to know roughly what speed ballpark a language is in when selecting a weapon of choice, though perhaps the memory usage is most interesting, $$$ practically, leaving aside dev productivity, joy of coding, etc. etc. etc.

In my experience, in a production app, too many CPU cycles are spent formatting data for message exchange. I'd love to see a comparison of JSON serializers in each language if you ever have time.

Collapse
 
auditorofdoom profile image
Fredrik Olsson

That's awesome!

Collapse
 
kataras profile image
Gerasimos (Makis) Maropoulos

Thank you for the feedback!

Collapse
 
n1try profile image
Ferdinand Mütsch

Cool post ;) But are you sure you want to compare against Iris? Check out this discussion: reddit.com/r/golang/comments/57w79...

Collapse
 
galdin profile image
Galdin Raphael

This post has been featured in the Visual Studio Magazine 🎉

Collapse
 
lexlohr profile image
Alex Lohr

I think it's not entirely fair to compare a 100% compiled language like Go to one that runs on a JIT compiler like C#/.NET - can you compare it to something else like rust/iron, for example?

Collapse
 
maxart2501 profile image
Massimo Artizzu

That's a good point, but in the end it depends on what we want to achieve. If the goal is to just serve a small MVC application, we'd rather look at parameters like latency, number of served request, memory consumption and so on.

C#, like Java, leads with a wide margin in other context, like having solid frameworks for scalable applications. Giants use C# and won't stop any time soon. Even smaller realities like StackExchange use C#.

This test makes evident that you should choose the right tools for every task.

Collapse
 
iwanttocomment profile image
Calvin

please do this again but updated to the latest of each lang