by jmull · 4y ago · 0 comments
But I had to laugh at their example that “crushes” (why the embarrassing phrasing?) node.js.
Why, returning plain text is as simple as declaring a private “PlainTextActionResult” class that implements the IActionResult and the IActionResult method ExecuteResultAsync, creates an HttpContext.Result, sets the status code symbolically and the content type textually, manually calculates the content length, and returns an asyc Task object!
“Crushed it!” (with Enterprise-y code).
All the enterprisey things in .NET are a god send in a 10k loc web app with solid debug and profiling capabilities.
And all that will save you time and money.
So many developers try to compare the structures of different stacks based on "hello worlds", whereas, the actual issues crop up in actual web development.
With both .net and nodejs.
They both do the job fine (you mention 10K LOC, but I’m not sure that you mean because that’s still comfortably tiny — a one-person app at most, where pretty much anything works.)
In my experience they both scale just fine. Your limiting factors are much more defined by your app architecture, dev group politics (as reflected in response to management), and what I’ll call your dev workflow process (how many minutes is it, between when you as a dev make a final, correct source change, and the change makes it far enough that another person can see and evaluate it in the software?)
var app = WebApplication.CreateBuilder(args).Build();
app.Map("test", () => "hi there");
app.Run();So why the tortured code for the performance test?
Click through to the link to the code. BTW, the link is a screenshot of the code, but that doesn't happen to show the ugly part.
Could be shenanigans, could just be a minor stupidity. IDK, but it doesn't fill me with confidence in the article's general message.