Most active commenters
  • Xelbair(3)
  • mrsmrtss(3)
  • gf000(3)

←back to thread

.NET 10

(devblogs.microsoft.com)
489 points runesoerensen | 22 comments | | HN request time: 0.247s | source | bottom
Show context
jitbit ◴[] No.45888669[source]
For us, every .NET upgrade since .NET 5 has gone surprisingly smoothly and reduced CPU/RAM usage by 10–15%.

We were even able to downgrade our cloud servers to smaller instances, literally.

I wish .NET was more popular among startups, if only C# could get rid of the "enterpisey" stigma.

replies(26): >>45888799 #>>45888804 #>>45889332 #>>45891939 #>>45896032 #>>45898279 #>>45898305 #>>45898358 #>>45898503 #>>45898877 #>>45899062 #>>45899235 #>>45899246 #>>45899326 #>>45899445 #>>45899481 #>>45899858 #>>45900544 #>>45900791 #>>45900829 #>>45903218 #>>45904345 #>>45904435 #>>45905041 #>>45906073 #>>45907122 #
1. olavgg ◴[] No.45898305[source]
As a startup, what is it in for me to switch from Java, Spring Boot, Hibernate, Beam, Flink, Pulsar, Vault, KeyCloak ecosystem to C#.Net? Is the documentation better? Do I get better performance? Is the community larger and more stable?
replies(4): >>45898404 #>>45898520 #>>45899801 #>>45900264 #
2. littlecranky67 ◴[] No.45898404[source]
Yes.
3. Xelbair ◴[] No.45898520[source]
Vault, Keycloak, Flink are language agnostic or there exist bindings for most popular languages.

Documentation is vastly better compared to Java ones, it's like day and night, LINQ is vastly superior to anything that Java offered - but i haven't used java in a very long time. And every time i had to write java it felt like i went backwards in time by 5-10 years.

If i remember right Java's webserver beats ASP.NET in performance benchmarks but .net's one performance is good enough that it does not matter until you hit really big usercount - and at that point you usually have to rethink your architecture anyways.

But frankly .net is still mostly Microsoft Java but with better developer ergonomics in my opinion. It did shed a lot of overengineered OOP legacy from .net framework days though and we're seeing major performance improvements with every version.

replies(3): >>45898814 #>>45901216 #>>45902154 #
4. mrsmrtss ◴[] No.45898814[source]
>If i remember right Java's webserver beats ASP.NET in performance benchmarks

That's not the case anymore. Kestrel is one of the fastest servers there is, and it beats every Java server out there.

replies(3): >>45898948 #>>45899678 #>>45899712 #
5. hans0l074 ◴[] No.45898948{3}[source]
I do not have any benchmarks other than this[1] to refer to, but I work with Quarkus[2] and Java 25 LTS (just recently released) services deployed on AWS EKS and we are very happy with the performance (for mobile game backends)

[1]: https://sharkbench.dev/web [2]: https://quarkus.io/

6. Xelbair ◴[] No.45899678{3}[source]
the famous benchmark that put ASP.NET in #1 spot was hyperoptimzied to hell while competing with normal implementations of other systems. https://web.archive.org/web/20250330225652/https://dusted.co...

archived version becasue original one gives 404

currently according to techempower benchmarks ASP.net is 55th overall in minimal variant, while being 83 in normal one in Fortunes benchmark which is basically a normal usecase.

While most java framworks oscillate between 10-30

https://www.techempower.com/benchmarks/#section=data-r23

EDIT: there's also an entry for aspnetcore at 35th

replies(3): >>45899997 #>>45900187 #>>45905107 #
7. dustedcodes ◴[] No.45899712{3}[source]
That's not what Microsoft's own sponsored benchmarks say:

https://www.techempower.com/benchmarks/#section=data-r23

replies(1): >>45899847 #
8. troupo ◴[] No.45899801[source]
Most of that ecosystem is language agnostic, or offer much more ergonomically sane APIs in dotnet. This is especially true for anything coming out of Google (e.g. Dataflow which runs on top of Apache Beam).

C# itself has way better DX (object initializers alone are worth the switch), and most language features don't feel bolted on like with Java (anything from functional programming to extension methods to whatever).

And at least 6 years ago .net with default settings required significantly less resources (RAM, CPU) and yad significantly faster startup than comparable Java code.

C# is also significantly more consistent. You might not use LINQ, but since everything is IEnumerable, you will use the same set of methods on everything. None of the Lis.of...Collectors.collect idiocy from Java.

I also found Asp.net to have significantly less undebuggable magic than Spring.

replies(2): >>45900211 #>>45902190 #
9. mrsmrtss ◴[] No.45899847{4}[source]
Look at plaintext benchmark, if you want to compare just servers. Also look at Spring score in fortunes, which is the more common Java stack and I think a more suitable comparison.
10. mrsmrtss ◴[] No.45899997{4}[source]
Look at plaintext results if you want to compare just servers. Fortunes benchmark has too many variables (including db queries etc) to say anything about server performance. As for fortunes benchmark, for more realistick Java performance numbers I would look at Spring. Also there are many shady things on those Java bencmarks.
replies(1): >>45904056 #
11. dustedcodes ◴[] No.45900187{4}[source]
> archived version becasue original one gives 404

Thanks, fixed now. I literally just migrated from GCP to Hetzner over the weekend and was about to finish the migration today :)

12. stanac ◴[] No.45900211[source]
I sometimes miss Spring magic when working with ASP.NET, and I worked 12+ years with C# and only a year with Spring. Not saying one is better than the other, it's always a choice, less magic = more boilerplate and less boilerplate = more magic.
13. griffiths ◴[] No.45900264[source]
As others have mentioned Vault, Keycloak, Flink are language agnostic. Regarding the switch from Java to .NET, I would rather recommend switching to Kotlin instead of .NET for a developer experience similar to C#, while still keeping your existing expertise in Java and its ecosystem. And this comes from someone in a .NET shop currently, but have worked with Java before. IMHO both languages and surrounding ecosystems are good. Both have their pros and cons and quirks.
14. haspok ◴[] No.45901216[source]
> but i haven't used java in a very long time

What was the last Java version you used? There has been a huge momentum in adding new features lately, granted, it is slower than in C# (Java's top priority is backwards compatibility, so it does not have the luxury of shedding old stuff or changing them once they are in), but in the last couple of years it has improved tremendously. The JVM (especially in the garbage collection front) but also the language - half of an ML-style language is there (for example, ADTs and pattern matching), the other half is coming soon!

15. gf000 ◴[] No.45902154[source]
> Documentation is vastly better compared to Java ones, it's like day and night

This is absolutely not my experience, especially when it comes to the ecosystem and third-party libraries. Like Java is pretty much the best in this category.

replies(1): >>45903406 #
16. gf000 ◴[] No.45902190[source]
> and most language features don't feel bolted on like with Java (anything from functional programming to extension methods to whatever)

Java doesn't have extension methods and while both are decent languages, C# is the one that likes implementing every conceivable language feature immediately, while Java takes a while to design a bigger feature that will replace several smaller ones' use cases.

replies(1): >>45905761 #
17. Xelbair ◴[] No.45903406{3}[source]
well you can't judge 3rd party libraries, can you? by that metric js/ts would be the worst thing in existence.

I've seen some great, some horrible 3rd party docs on .net side - same with java.

18. banashark ◴[] No.45904056{5}[source]
I think saying that Spring is the representative of Java metrics is somewhat equivalent to saying that full aspnet mvc is the representative of dotnet metrics.

On the dotnet side, both Oxpecker and Giraffe (Giraffe being written by the author of that post) perform very well with simple code and from what I see, no "tricks". It's all standard "how the docs say to write it" code (muuuuch different than those platform benchmarks that were rightfully scrutinized in the referenced blog post).

On the jvm side, I started looking for a reference near the top without any targeted non-default optimizations (which is really what I personally look for in these). The inverno implementation has a few things that I'd call non-standard (any time I see a byte buffer I imagine that's not how most people are utilizing the framework), but otherwise looks normal. I recall an earlier quarkus implementation that I read through a couple years ago (same repo) that wasn't as optimized with small things like that and performed very well, but it seems they've since added some of those types of optimizations as well.

All to say: If you venture outside the standard of either platform (full fatty aspnet/ef or spring/hibernate) you can make the tradeoff of framework convenience for performance. However when it comes to the cost/benefit ratio, you're either going to be joining a company using the former, or writing your own thing using the latter (most likely).

19. achandlerwhite ◴[] No.45905107{4}[source]
It's no longer so hyper optimized and performs very well today in the metric compared to any other comparable framework.
20. troupo ◴[] No.45905761{3}[source]
> while Java takes a while to design a bigger feature that will replace several smaller ones' use cases.

Java is quite busy also implementing features that are small in other languages like text blocks.

And I wish Java would design bigger features that would replace several "smaller ones", but that is almost never the case. It's almost always just a new big feature bolted on to the language that is almost there, but not quite

There are many reasons for that, none of them simple, and it doesn't help that there's also the attitude of "those lesser languages cannot compare to the greatness that is Java" [1]

If we're talking about Java, somehow you're still required to do builder patterns and manually create `.of` constructors for everything. Where C# has had object initialisers and pervasive IEnumerable with a very simple interface that nearly everything uses. And that is only scratching the surface of DX.

Almost every feature bolted onto Java seems to take several times more code, and doesn't really work with the rest of the language.

Don't get me wrong, I quite like working with modern Java. But I had the chance to work at a company where micro services where developed in both Java and C#, and the difference is still light and day.

[1] https://news.ycombinator.com/item?id=28985688 "our goal isn't to adopt the strategy of less successful products, but to forge our own"

replies(2): >>45907803 #>>45907828 #
21. gf000 ◴[] No.45907803{4}[source]
> Java is quite busy also implementing features that are small in other languages like text blocks.

It's a small feature which is immediately understandable by anyone coming straight from Java 1.2, it doesn't materially increase the complexity of the language and is arguably one of the best implementation among different languages. So not really sure if it's a good counterpoint.

Meanwhile records arrived several versions ago with sealed interfaces/classes on the horizon already, so now they together form a complete ADT feature. Pattern matching builds on top. And sure, these are no novel features, MLs had this decades ago, but the implementation is very nice, with minimal additional developer complexity and some small DX improvement (records replace the majority of Bean usages). In the future, withers may come that would help with both object initialization AND record "mutation". Where Java spends more development budget is on the runtime side, e.g. virtual threads can replace async code in many cases, so the language doesn't have to get all the complexity of an async feature.

Meanwhile C# has many many "one-off" features and they really can have unexpected interactions and make the language quite a bit harder to understand. Some of them are absolutely wonderful, but I am on a "the-smaller-the-merrier" language team.

22. vips7L ◴[] No.45907828{4}[source]
> Java is quite busy also implementing features that are small in other languages like text blocks.

Or named parameters or compile time null safety. Everyday I inch closer to moving over to C# from Java.