Live data from Hacker News

SimpleW – Web Server Library .NET Core

github.com

51–60 of 80 posts

Re: SimpleW – Web Server Library .NET Core

#51
post #36

Earlier quoted context omitted.

Enable trimming

Simple claim with a complex story. 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.

Soo many dependencies do not support AOT.

Re: SimpleW – Web Server Library .NET Core

#52
post #31
post #3

But why? 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.

> ASP.NET Core is one of the best web frameworks 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

The webserver variability isn't really so wide because the in the box offering since Core has been pretty good, flexible and works for most use cases. And while I really like FastEndpoints a lot over the minimal api stuff, even that is pretty straight forward.

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.

Re: SimpleW – Web Server Library .NET Core

#53

Does this mean a developer doesn't have to install nginx or iis ?

Have you tried Kestrel, YARP and Aspire?

I'm not familiar with YARP, but isn't Aspire still using Kestral? I think of Aspire as more of a code driven, flexible Docker-Compose alternative.

Re: SimpleW – Web Server Library .NET Core

#54
post #11

Not sure about this one. It's based on NetCoreServer which is great but it's definitely not something I'd be comfortable putting into production over kestrel or IIS. 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.

I really wish that Kestrel was available as a standalone library. Kind of like Jetty on the JVM.

Re: SimpleW – Web Server Library .NET Core

#55
post #17

Earlier quoted context omitted.

The library's tagline says "Powerfully Simple. Blazingly Fast." So there. ::folds arms:: 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 sol…

I hate when someone's software advertises itself as 'blazingly fast' and then provides NO DATA to back up the claim. It's possible that it really is blazingly fast, but to make the claim and provide no data is sad. In God we trust - all others please bring data.

> I hate when someone's software advertises itself as 'blazingly fast' and then provides NO DATA to back up the claim

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.

Re: SimpleW – Web Server Library .NET Core

#56
post #55

Earlier quoted context omitted.

I hate when someone's software advertises itself as 'blazingly fast' and then provides NO DATA to back up the claim. It's possible that it really is blazingly fast, but to make the claim and provide no data is sad. In God we trust - all others please bring data.

> I hate when someone's software advertises itself as 'blazingly fast' and then provides NO DATA to back up the claim 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.

Cool! Please add link to that page from your github project's main page.

Re: SimpleW – Web Server Library .NET Core

#57
post #31

Earlier quoted context omitted.

> ASP.NET Core is one of the best web frameworks 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

>The fact is there are very few dotnet web servers. SRE here, very few because Microsoft is strongly opinionated with ASP.Net and those opinions most sense for VAST majority of their users.

> those opinions most sense for VAST majority of their users

I have a much more nuanced view.

I think that ASP.Net is the de facto standard for being backed by Microsoft since many years. From the gold time when ASP means IIS to now when Kestrel was cannibalized by Microsoft.

As a developer, working with the most widely used stack guarantees that these choices won’t be questioned in critical situations. I’m not saying Kestrel is bad, but it doesn’t automatically fit every scenario.

- 15 years ago, there were Apache or IIS.

- Then nginx changes the game and kicks their ass

- Then webserver starts being written into script langage for better integration (Ruby, Python), no more CGI and nginx as reverse

- Then node changes the game

- Now : caddy and other alternatives... but still not web server in PHP (troll inside)

I see a pattern to not believe aspnetcore is the only one and the best.

Re: SimpleW – Web Server Library .NET Core

#58
post #3

But why? 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.

One of the use cases that stands out to me is dropping an API into a console application without having to use a different project. With ASP.NET I have to set up a new project, use a different SDK and then re-register all my services in its service collection. It looks like this one is bringing it closer to how it's done in Go which I personally really like.

You shouldn't have to change the SDK.

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...

Re: SimpleW – Web Server Library .NET Core

#59
post #30

Earlier quoted context omitted.

> The library's tagline says "Powerfully Simple. Blazingly Fast." > 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…

Did you try compiling all the test to native thru AoT? There are probably some optimizations to improve the Kestrel score by altering the config, or maybe changing how the API is written: 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 pe…

> There are probably some optimizations to improve the Kestrel

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.

Re: SimpleW – Web Server Library .NET Core

#60
post #3

But why? 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.

> ASP.NET Core is one of the best web frameworks

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.

Post reply on HN