by sltr · 1y ago · 0 comments
Joking aside, I do agree that ASP.NET Core is a behemoth. On .NET 9, I just now did `dotnet new webapi` followed by `dotnet publish --self-contained -p:PublishSingleFile=true` and the binary is 103MB. That would blow up the size of a mobile app considerably, just to listen to HTTP.
There a separate use case that SimpleW won't solve: When you're on a platform that .NET Core doesn't support, like Raspberry Pi Zero (armv7l). In this case all you have is the mono framework and binding to raw ports.
> Joking aside
author here.
I agree with your remark ^^
Each time i read some news about a new framework with tag "blazingly fast", i'm thinking "lol".
So i had to resist to the temptation... And finaly when doing a small benchmark, performances were not bad at all (https://stratdev3.github.io/SimpleW/guide/performances.html) and i let the "clickbait" title.
My targets are small to medium traffic and embeded devices (dotnet/android).
app.MapGet("/api/test/hello", () => "Hello World!");
As a general web server, I think I'd always go for Kestrel over this, but as another poster said, if you're trying to add an endpoint to some desktop application, this would be perfect.
You're right.
To be fair, i have to run many other benchmarks including one with the best recommanded optimizations for each projects.
a little time consuming but definetely on my todo list.
I think you are expecting too much here.
I've just tried the same, but with native-aot (build to native code). On Windows it was around 10mb, including routing, JSON serialization and openapi support. Startup is nearly instant.
If you include the dotnet runtime it's much bigger, but that's expected.
Edit: built with dotnet publish -r win-x64 -c Release /p:PublishAot=true /p:PublishTrimmed=true /p:PublishSingleFile=true
We moved a couple of critical services over to Go because of those two issues and it turned a few heads.
I notice Apple had similar problems and moved some of their back end to Swift from JVM recently. There was a post on here.
I have some heavy ASP.Net stuff too, yep, we have to prewarm it before putting into production.
I'd blame Serverless more than ASP.NET Core for the bad performance in that case though.
I thought about mentioning AOT and trimming, but my comment was already long.
AOT in ASP.NET is still a moonshot in most cases, and a non-starter in existing web apps due to dependencies not supporting AOT.
Worth mentioning that as of .NET 9 AOT is not supported on Android.
agree, that's why there is a performance benchmark at https://stratdev3.github.io/SimpleW/guide/performances.html with code as you can reproduce at your own.
i'm adding other tests, more complete than the hello world one.