News for hackers. Stuff that matters.
Re:XYPlorer Is Written in VB6 by brokencode on Saturday January 11, 2025 @03:22AM (#42664278)
As much as I like C# the language, I honestly think that it and .NET are fundamentally flawed when it comes to performance.

Native Windows apps just never seem load that fast or work that great. It’s kind of crazy how much better the basic OS apps feel in macOS compared to Windows.

I wish Microsoft would have gone in a direction more similar to Apple, with an AOT compilation and reference counting.

JIT and garbage collection sound great in theory, but in practice I’ve found them both to be loaded with footguns that more than eliminate any benefits. At least with .NET, that is.

Re:XYPlorer Is Written in VB6 by sedatk on Saturday January 11, 2025 @03:57AM (#42664443)
.NET supports native AOT for a while now.
Re:XYPlorer Is Written in VB6 by brokencode on Saturday January 11, 2025 @04:31AM (#42664584)
I don’t have a lot of experience with this, but that’s mainly because there’s no way to compile my company’s application with Native AOT. At least not without a significant amount of work.

This is because there are many limitations in what can be compiled this way, and most C# applications and libraries were never built with such limitations in mind.

Re:XYPlorer Is Written in VB6 by sedatk on Saturday January 11, 2025 @12:33PM (#42667404)
AFAIK, the limitations are just some (not all) reflection API is missing, and trimming can cause problems. That’s pretty much about it. Obviously it’s a problem if you need those, but I wouldn’t call it “many limitations”.
Re:XYPlorer Is Written in VB6 by neonsunset on Saturday January 11, 2025 @03:30AM (#42664330)
Most Windows apps that are guilty of being slow and poorly made do not use the .NET you speak of at all. If they did they would work much better!
Re:XYPlorer Is Written in VB6 by brokencode on Saturday January 11, 2025 @04:23AM (#42664550)
Do you have some examples of large and complex C# applications with really good performance?

I’m hard pressed to think of any Microsoft software at all that I think feels really nice. Except for VSCode, which is of course built on Electron and not .NET.

The only thing that comes to mind is Paint.NET, which doesn’t seem like all that big of an application. It’s very nicely done, but I think it’s only got like a single dev working on it, so couldn’t be that big.

Re:XYPlorer Is Written in VB6 by dagaci on Saturday January 11, 2025 @05:23AM (#42664815)
Devtoys is great and open-source and .NET and cross-platform * https://devtoys.app/

and in context to the thread files-community/files is great and open-source and .NET * https://files.community/ (its actually 96% .net and 3.1% c++)

Re:XYPlorer Is Written in VB6 by tonyedgecombe on Saturday January 11, 2025 @07:03AM (#42665313)
Isn't Visual Studio (not VSCode) written in .Net.
Re:XYPlorer Is Written in VB6 by brokencode on Saturday January 11, 2025 @12:23PM (#42667330)
That's specifically an example of an application that I think is slow. It's slow to load and often slow to respond. The support for Git has to be amongst the slowest of any professional application in the world. But I'm pretty sure it has a deeply flawed architecture compared to VSCode.
Re:XYPlorer Is Written in VB6 by neonsunset on Saturday January 11, 2025 @12:29PM (#42667377)
It's written in C++ and .NET Framework. VS is mostly an exception anyway. I much prefer to use VS Code + Rider instead. Your comments leave me with impression that you are not interested in understanding the performance profile of .NET and are looking to engage in a language flamewar instead.

Edit: I stand corrected, based on reply in a sibling comment most of the perception stems from how .NET Framework works. Understandable.

Re:XYPlorer Is Written in VB6 by neonsunset on Saturday January 11, 2025 @05:29AM (#42664846)
> Do you have some examples of large and complex C# applications with really good performance?

Most of them. An implementation would have to go out of its way to make itself perform poorly if it is built on top of, say, .NET 8.

Have you heard of Ryujinx? Or Nethermind? Or Garnet? Or have you seen that .NET's Regex engine, written in pure C#, is the third fastest in the world after Intel's Hyperscan and Rust's Regex crate?

Re:XYPlorer Is Written in VB6 by brokencode on Saturday January 11, 2025 @12:47PM (#42667526)
Fair enough, maybe my perceptions of .NET performance are mostly based on old versions of .NET without all the tiered compilation and other features to make JIT warmup less of an issue.

We are only just now wrapping up the conversion at work to .NET 8 from 4.8, so it will be interesting to see the performance numbers once that is complete.

Our .NET application has millions of lines of code, so JIT compilation time in particular in the old .NET could be very painful.

Re:XYPlorer Is Written in VB6 by neonsunset on Saturday January 11, 2025 @01:23PM (#42667835)
At my previous employer, moving from .NET Framework 4.6.1 to .NET Core 3.1 resulted in response latency of one of the particularly heavy requests going from ~2s to ~300ms :)

The difference between 4.8 and 8 can easily be tenfold, depending on the workload and bottlenecks (if it's a slow DB query - EF Core might compile it to a more efficient variant in, say, EFC 8, but if it's linear scan - not much can be done).

Re:XYPlorer Is Written in VB6 by Kwpolska on Saturday January 11, 2025 @04:50AM (#42664644)
Most applications that ship with Windows are not written in C#/.NET. Microsoft tried to rewrite everything this way around Vista, but they failed hard due to stability and performance issues. In Windows 11/Server 2025, the only things written in .NET are administrative tools, like most MMC snap-ins (e.g. Event Viewer), Virtual Machine Connection, or Server Manager.
Re:XYPlorer Is Written in VB6 by neonsunset on Saturday January 11, 2025 @05:30AM (#42664852)
To be fair, .NET back then was just not where it is today. And the C++ faction within Microsoft did not help that either.

But a lot of people are completely out of touch, thinking something along the lines of "Clearly Golang is managed by YouTube and Google Search teams" except about .NET whenever complaining about whatever happens to Windows nowadays.

Re:XYPlorer Is Written in VB6 by p_ing on Saturday January 11, 2025 @09:39AM (#42666165)
> Native Windows apps just never seem load that fast or work that great.

On NT, process creation is very slow compared to most (all modern?) other operating systems, where-as thread creation is near-instant.

Not sure what you mean by 'work that great'.

> JIT and garbage collection sound great in theory, but in practice I’ve found them both to be loaded with footguns that more than eliminate any benefits.

I can't think of a single C# Console, Web, or WPF app I've created where I have to explicitly concern myself with JIT or GC. That doesn't mean they're not out there (games? maybe? Fez? Stardew Valley?), but I think you'd find one calling explicit GC methods somewhat rare, or being concerned with how long an app takes to JIT.

I used to deal with SharePoint Server quite a bit which is _slow_ to start due to JIT, but I didn't care because I'd just have an uptime monitor app fetch a page or few on the front end to make sure it JITs before (re)adding it to the load balancer.

Re:XYPlorer Is Written in VB6 by kgeist on Saturday January 11, 2025 @10:11AM (#42666376)
I've built many apps using C#/Winforms and the runtime's performance was never an issue.

In my experience, main performance killers are:

- calling blocking functions on the UI thread

- N+1 problem

And there's nothing specific to C# about it. .NET garbage collection becomes an issue only when you allocate lots of objects per second (100k or millions), and very few UI apps do that. If there's perceived sluggishness, I doubt it's the runtime.