upvote
> largely by focusing on eliminating allocations rather than doing anything particularly clever algorithmically.

Did rewriting it in C# make this easier, or did rewriting make this easier?

reply
I've of course not tried rewriting it in other languages, so take that with a grain of salt. But the code is by design required to stay aligned with the source codebases as the ports are continuously updated with upstream improvements, so I don't think the gains are coming from being a very different rewrite. What I see is just how much easier it is to express efficient code in c# without loosing expressiveness, with a really nice to use low level support (Span/ReadOnlySpan, stackalloc, built in intrinsics support, easy to use pooling, etc) so you can refactor where it matters.
reply
I think GP was asking if the speedup was due to eliminating allocations (maybe by doing them upfront?), not if the expressiveness of efficient code is easy.
reply
Outside of .NET itself, C# is one of those rare things Microsoft got disgustingly correct. It's entire runtime is cross-platform and MIT licensed.
reply
You can probably blame both on Anders Hejlsberg (https://en.wikipedia.org/wiki/Anders_Hejlsberg), who started off with Turbo Pascal and Delphi (both still held in high regard) and then, after getting poached by Microsoft, where he (co-?) led the development of .NET, C# and then TypeScript.
reply
I was going to learn C# then I realize it's probably the only language that still has commercial, non domain specific paid library. (eg. Paid react component is fine for me, but a paid circuit breaker library is not)
reply
Nah, C, C++, Java, Ada, PL/I, NEWP, COBOL, Fortran, RPG,.... have enough commercial libraries to chose from.
reply
> It's entire runtime is cross-platform and MIT licensed

It does not run on OpenBSD. And I think it only got recently ported on FreeBSD. Yes, they are “small” platform, but lot of languages are there.

reply
Also embedded, mainframes and micros.

There is Meadows for embedded, and the oldie .NET Compact Framework, but it isn't the same regarding capabilities like real time processing.

reply
Partially, if only the first AOT story wasn't like NGEN, and stuff like Span, and all the low-level improvements since C# 7 were already there in version 1.0.

Unfortunately even today their Windows team keeps being quite dismissive, pushing C++ instead.

Even the new Windows ML stuff has, yet again, better C++ and Python story than C# (WIP at the Ignite sessions time).

Unlike how Apple uses Objective-C and Swift, or Google Java and Kotlin, managed runtimes have an hard upsell on Windows division.

While Azure nowadays rather push open source projects in Go, Rust, Java than .NET.

Yeah it is a great development stack, yet its own creator has some issues pushing its adoption even internally.

reply
I'd claim this is the rewrite done by people that know what they're doing that is responsible for most of the gains vs. C#'s compiler to magically make things run faster.

Sure the C# compiler is great and mature; and .NET Jit probably great too. But these massive gains can only be explained by "do less stoopid stuff".

reply
That plus having a strong language that makes it easy to express safely efficient code. Most of the performance gains come from how easy it is to measure and refactor code where it matters without impacting readability, which is something that I find a lot more difficult with other programming languages, even in this era of AI.
reply
If I was in charge of Java applications, I'd rewrite them all to C#, Rust, Zig, or even Golang which I don't praise, even if that meant for them to be slower than the original Java, only to escape the Oracle hell.
reply