From a performance standpoint, it is very difficult to beat kestrel now. If you don't want all the fancy Microsoft bullshit (I certainly don't), use the minimal APIs and map out routes to lightweight HttpContext handlers.
thank for the pointer !
The syntax seems cool and comprehensive, i like it.
I made some test and like its name, it is very fast : performances are closed to SimpleW, just a little bellow. But its memory footprint is the half, so i'm impressed. I will check the code, sure there are interesting things into.
also what does performance matter on webservers
Agreed, but it is the least smelly pile they have on offer.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/m...
ASP.NET Core is one of the best web frameworks, extremely modular and flexible. It's low level components (http server, routing) can be used as a foundation for new web frameworks.
That said I think some diversity / competition / cross-pollination should be welcomed in the .NET space.
Not a fair comparison but I’m glad Avalonia exists despite WPF, for example.
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).
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.
You can create a class library ASP.NET Core Server by using a FrameworkReference [1]. I can't remember the library, but there was one that had its own `IHostedService` with its own embedded ASP.NET Core Server startup within it.
If your `WebApplication` requires services, of course you're going to have to register its dependencies on its `IServiceCollection`. Though, you can use factory methods for service registration to use an external `IServiceProvider`.
For console applications, I would recommend using `Host.CreateEmptyApplicationBuilder` [2]. Makes it a lot easier to configure services for Console applications. It also handles `IHostApplicationLifetime`s.
[1] https://learn.microsoft.com/en-us/aspnet/core/fundamentals/t...
[2] https://gist.github.com/pethin/7e5edd7614ff2f51c06c086e1bc7c...
The full asp.net out-of-the-box experience is tailored to the most common use case, which is a plain web service.
I think you can even run the Kestrel HTTP server without all the asp.net pipelines, infrastructure and without dependency injection.
Also the common WebApplication.CreateBuilder() includes a lot of default configuration (batteries included), there is also CreateSlimBuilder() and CreateEmptyBuilder().
I wanted to start with something small where I could read or write the code in a reasonable amount of time.
My usage was, and still is, for low traffic. I don't intend to replace the Kestrel beast.
Just a framework you can quickly understand without being lost in documentation once you want to custom a part.
In your opinion. Not everyone is of the same mind when it comes to software design. Sometimes the motivations are different.
As a community we should encourage those looking to find their own path. We become myopic otherwise.
That's the reason I asked the question "why?". It's probably much slower (asp.net got performance/memory optimized to a ridiculous extent), and might contain dangerous vulnerabilities (creating a secure http server is hard!).
I don't think so.
The fact is there are very few dotnet web servers. ASP.NET Core is supported by the owner of the dotnet langage who is also the M of the GAFAM.
There is some place in the ecosystem for other alternatives
It's not my favorite, it starts slow and I'd rather go up to JS/TS for scripting flexibility or down to Rust for really lightweight performance with fast startups. It's one of the better all-around options though. I'd rather use it over Java every day of the week and there are adapters for most things you'd ever need to communicate with.
SRE here, very few because Microsoft is strongly opinionated with ASP.Net and those opinions most sense for VAST majority of their users.
...based on what?
author here.
You don't have to keep it behind a reverse proxy like nginx.
But you can, especially if you have multiple APIs and you want to keep thing separated for security reason.
Example :
nginx:443 (reverse proxy, domain name routing)
|
|-> website1:8081 - docker container with SimpleW
|-> website2:8082 - docker container with SimpleW
|
...
that's the reason why i start the project. I had time and wanted something simple as my needs.
The default template is great and everything in VitePress has been thinking to create documentation. Very nice project.