In Iris Go vs .NET Core Kestrel in terms of HTTP performance, an article by @kataras, he explains how his Iris framework beats AspNetCore and also tells his story on how some of the DotNet community members insulted him because of technological disagreements. In some cases, he is right and I am sure we can have a more constructive discourse. I appreciate his work and the technology he developed.
I tried his code and yes, Iris outperforms Kestrel when it returns a short constant string (value
). In real world scenarios, we don’t do this usually. We do so many different things to prepare the response. To simulate a real-world example and a fair benchmark, I modified his example to return 1KB randomly generated string as response. On my machine (Corei7-7700K) Kestrel does the job 10+ times faster.
BTW, this result is more about runtime, memory management and compiler performance. Iris is still a lightweight framework comparing to AspNetCore and may perform better in some cases.
Bombarding http://localhost:5000/api/values/5 with 500000 requests using 125 connections
500000 / 500000 [=============================================================================================================] 100.00% 5s
Done!
Statistics Avg Stdev Max
Reqs/sec 99891.00 13123.35 111093
Latency 1.25ms 1.00ms 39.00ms
HTTP codes:
1xx - 0, 2xx - 500000, 3xx - 0, 4xx - 0, 5xx - 0
others - 0
Throughput: 110.60MB/s
Bombarding http://localhost:5000/api/values/5 with 500000 requests using 125 connections
500000 / 500000 [===========================================================================================================] 100.00% 1m6s
Done!
Statistics Avg Stdev Max
Reqs/sec 7501.00 199.76 9393
Latency 16.66ms 3.09ms 55.00ms
HTTP codes:
1xx - 0, 2xx - 500000, 3xx - 0, 4xx - 0, 5xx - 0
others - 0
Throughput: 8.31MB/s