I know it’s not MVC, that’s why I compared it to the non-MVC Go version. I may be wrong but I believe Kestrel is used in both cases, just that in the MVC version the MVC middleware sits in the HTTP request pipeline.
You got very similar results in the second article. Now, it is unsurprising that the Go version, being a native .exe, is faster; native ASP.NET Core should level the playing field in that regard.
That being said, looks like Microsoft has to do some optimizing/slimming down of the MVC middleware.
By the way, the non-MVC version can be shortened like this:
namespace Test
{
public class Program
{
public static void Main(string[] args)
{
new WebHostBuilder()
.UseKestrel()
.ConfigureServices(x => x.AddRouting())
.Configure(x => x.UseRouter(new RouteBuilder(x).MapGet(“api/values/{id}”, ctx => ctx.Response.WriteAsync(“value”)).Build()))
.Build().Run();
}
}
}
Anyway, nice articles!