* **Node.js (express + throng) [Javascript]**: https://nodejs.org/, latest version **10.12.0**, express: https://github.com/expressjs/express latest version **4.16.4** and [throng](https://www.npmjs.com/package/throng) latest version **4.0.0**
## Results
* Throughput - `how much data transferred per second`.
* Reqs/sec (Requests Per Second in Average) - `the highest the better, important`.
* Latency - `the smallest the better, important`.
* Time To Complete - `the smallest the better, important`.
| Name | Throughput | Reqs/sec | Latency | Time To Complete | Total Requests |
Go ahead and read the rest of the page to learn how you can reproduce the benchmarks. Don't be afraid! It's actually very easy, you can do things like that as well!
## Old results (August of 2017)
**Go vs .NET Core in terms of HTTP performance (Sa, 19 August 2017)**
The first test will contain a simple application with a text response and the second will render templates + a layout.
## Simple
We will compare two identical things here, in terms of application, the expected response and the stability of their run times, so we will not try to put more things in the game like `JSON` or `XML` encoders and decoders, just a simple text message. To achieve a fair comparison we will use the MVC architecture pattern on both sides, Go and .NET Core.
.NET Core MVC Application, written using 86 lines of code, ran for **1 minute** serving **82608.44** requests per second within **1.51ms** latency in average and **235.36ms** max, the memory usage of all these was ~123MB (without the dotnet host).
Iris MVC Application, written using 27 lines of code, ran for **43 seconds** serving **114378.40** requests per second within **1.09ms** latency in average and **19.92ms** max, the memory usage of all these was ~12MB.
As [Josh Clark](https://twitter.com/clarkis117) and [Scott Hanselman](https://twitter.com/shanselman) pointed out [on this status](https://twitter.com/shanselman/status/899005786826788865), on .NET Core MVC `Startup.cs` file the line with `services.AddMvc();` can be replaced with `services.AddMvcCore();`. I followed their helpful instructions and re-run the benchmarks. The article now contains the latest benchmark output for the .NET Core application with the change both Josh and Scott noted.
.NET Core MVC with Templates Application ran for **38 seconds** serving **26051.53** requests per second with **188.01MB/s** within **4.78ms** latency in average and **417.39ms** max, the memory usage of all these was ~193MB (without the dotnet host).
Iris MVC with Templates Application ran for **23 seconds** serving **42501.30** requests per second with **306.60MB/s** within **2.94ms** latency in average and **24.93ms** max, the memory usage of all these was ~17MB.
This time we will compare the speed of the “low-level”.NET Core’s server implementation named Kestrel and Iris’ “low-level” handlers, we will test two simple applications, the first will be the same as our previous application but written using handlers and the second test will contain a single route which sets and gets a session value(string) based on a key(string).
## Simple
Spawn `1000000 requests` with 125 different "threads", targeting to a dynamic registered route path, responds with a simple "value" text.
.NET Core (Kestrel) Application written using **63 code of lines** ran for **9 seconds** serving **110150.12** requests per second with **19.95MB/s** within **1.13ms** latency in average and **81.78ms** max.
Iris Application written using **14 code of lines** ran for **7 seconds** serving **131268.51** requests per second with **24.41MB/s** within **0.95ms** latency in average and **19.92ms** max.
Node.js (Express) Application written using **12 code of lines** ran for **14 seconds** serving **70352** requests per second with **18.60MB/s** within **1.80ms** latency in average and **206.45ms** max.
Spawn `5000000 requests` with 125 different "threads" targeting a static request path, sets and gets a session based on the name `"key"` and string value `"value"` and write that session value to the response stream.
.NET Core with Sessions Application ran for **1 minute and 1 second** serving **61946.59** requests per second with **28.45MB/s** within **2.06ms** latency in average and **781.91ms** max.
Iris with Sessions Application ran for **1 minute and 1 second** serving **82477.76** requests per second with **25.32MB/s** within **1.53ms** latency in average and **286.23ms** max.
Node.js (Express) with Sessions Application ran for **1 minute and 42 seconds** serving **46962.17** requests per second with **12.81MB/s** within **2.53ms** latency in average and **368.01ms** max.