Live data from Hacker News

Fast machines, slow machines (2023)

jmmv.dev

61–70 of 72 posts

Re: Fast machines, slow machines (2023)

#61
post #15

Original author here! Thanks for (re)sharing. We previously discussed this at length in https://news.ycombinator.com/item?id=36503983 . I think this article has "aged well" in the sense that... nothing has changed for the better :( Since I wrote it, I did upgrade my machine: I now have a 24-core 13th Gen i7 laptop with a fast NVMe drive and... well, Windows 11 is _still_ visibly laggy throughout. Comparing it to KDE…

I'm not 100% sure, but I think the main reason the new Win11 apps like Notepad, File Explorer, Task Manager have a slow UI and the piece-by-piece drawing issues is because they combine UWP (the "new" tech) with the old Win32 controls, they are not a from-scratch rewrite. There seems to be some big overhead in using the two different UI frameworks together.

There was an attempt to make a Chrome OS competitor that had the entire UI rewritten in UWP, and when that got canceled it seems MS saved the new start menu + taskbar and bolted it on top of Win10, and for Explorer and other apps made this UWP+Win32 abomination. Actually when you profile Explorer you can also see DirectUI running, which is I believe another UI framework from the Office org. this time (maybe it's related to OneDrive).

Btw, apps written in C# using WPF can be surprisingly fast, so it's not really a problem of .NET managed vs. native apps. For ex. may favorite Git GUI (git-fork.com) is C#/WPF.

Re: Fast machines, slow machines (2023)

#62
post #43

Earlier quoted context omitted.

Im not really sure what are you talking about ;) HW become much much much faster. Mostly in speed of computing, but latency also dropped nicely. The letency bloat you see its 99% of software (OS). I still run Win2003 on modern desktop, and it flies! Really, booting/shutdown is quick. Im on spinning rust, so first start of webbrowser is slowish a bit, but once cached, its like 200ms-500ms depending on version (more mo…

Take a look on the latency of a keypress on your modern keyboard to when your CPU has the chance to first process the data, you'll be surprised. Depending on how your hardware is configured, it can reach 100ms there alone. Your mouse has an equivalent issue, except that it's not usually optimized to the same level, so the worst case is way more common. Audio has a much worse issue, and can lag a large fraction of a s…

Okey, yes.. Its a mix of HW/OS issue indeed. I remember my old gaming rig I assembled more than 10 years ago. Asus mother board, i5-760 CPU, ATI HD 6850. Win2003 as OS. All was tuned and it was really great. Basic DPC latency was around 30-40us. Under load it increased slighty but it was always Now catastrohpic (with I didnt knew at that time) event occured. After 10 years, Internal NIC burnded. I was like, okey.. I have dozens of PCI NICs, lets plug one and vioala. And I did. But, there was problems, after a while (hour or so) I noticed Audio glitches, especially when when there was network activitiy. After more investigation and reading mobo manual I noticed that IRQs were nicely spread for all internal mobo components + PCIe x16 bus. Other PCI ports were always shared one or another. I could do nothing to fix it.

PC now catch dust, I bought used HP 8200 PC with works nice, but its not gaming rig, standard DPC latency is around 2000us, with is quite large.. Still, for normal use that latency is great, Im very sensitive to lag and latency so if I had issues here, I would be mad.

At the end, some pics from my DPC stall fight:

http://ds-1.ovh.uu3.net/~borg/pics/DPClat.png

http://ds-1.ovh.uu3.net/~borg/pics/DPC_stall.png

Re: Fast machines, slow machines (2023)

#63
post #44
post #38

Earlier quoted context omitted.

In my defence, I never said it was efficient! Games always suck for battery because they’re constantly rendering.

They don't need to. Enable v-sync.

That’s still 60 times a second on my iPhone and 120 on my Samsung

Re: Fast machines, slow machines (2023)

#64
post #32

Earlier quoted context omitted.

> I would expect, actually, that it would be faster (all available cores get used). And I think this assumption is what's killing us. Async != parallel for a start, and parallel IO is not guaranteed to be fast. If you write a function: async Task LoadFile(string path) { var f = await load_file(path); return new ImageFile(f); } And someone comes along and makes it into a batch operation; async Task > LoadFiles(List pa…

well I mean you'd use await foreach and IAsyncEnumerable equivalent... async would mean the UI would not be blocked so I agree with the original commenter you replied to.

paraphrasing another reply I left here, if everyone just wrote their code correctly we’d all be writing C and everything would be safe and fast. I’ve fixed this exact issue with this exact cause (someone wrapped an await in a loop and it passed code review because our benchmark test still passed. But the benchmark test simulated the entire stack on a local network and when we deployed it, all of a sudden it took 5 seconds to load)

Re: Fast machines, slow machines (2023)

#65
post #33

Earlier quoted context omitted.

It depends how the application is written in C#. A lot of Modern C# relies on IoC frameworks. These do some reflection shenanigans and this has a performance impact.

This is literally what I said: > The author mentions rewriting core applications in C# on windows but I don’t think this is the problem. Write a simple hello world app in c#, compile it and see how long it takes to run vs a rust app or a python script - it’s almost native > My gut instinct is an adjustment to everything being asynchronous, combined with frameworks that introduce latency, context switching, and are th…

I didn't really know what that second sentence meant tbh.

Specifically with C# reflection will cause the app have a big affect on startup time. I have seen this with almost all the versions of .NET.

Re: Fast machines, slow machines (2023)

#66
post #63
post #44

Earlier quoted context omitted.

They don't need to. Enable v-sync.

That’s still 60 times a second on my iPhone and 120 on my Samsung

Competently done games have vsync and also a fps limiter.

They also decouple game logic and input from drawing :)

And then we have those that thing "OMG BIGGER FPS" is better and burn your video card when they render the startup menu at 1480 fps...

Re: Fast machines, slow machines (2023)

#67
post #66
post #63

Earlier quoted context omitted.

That’s still 60 times a second on my iPhone and 120 on my Samsung

Competently done games have vsync and also a fps limiter. They also decouple game logic and input from drawing :) And then we have those that thing "OMG BIGGER FPS" is better and burn your video card when they render the startup menu at 1480 fps...

I’m well aware how to make games, thanks, I’m the tech director on a AAA game with 15 years working on them.

I said “constantly” rendering and you and everyone seem to have taken the least charitable interpretation of what I said and decided I couldn’t possibly know what I’m talking about.

Re: Fast machines, slow machines (2023)

#68
post #67
post #66

Earlier quoted context omitted.

Competently done games have vsync and also a fps limiter. They also decouple game logic and input from drawing :) And then we have those that thing "OMG BIGGER FPS" is better and burn your video card when they render the startup menu at 1480 fps...

I’m well aware how to make games, thanks, I’m the tech director on a AAA game with 15 years working on them. I said “constantly” rendering and you and everyone seem to have taken the least charitable interpretation of what I said and decided I couldn’t possibly know what I’m talking about.

Well then, what are you talking about? Maybe my english isn't good enough.

Re: Fast machines, slow machines (2023)

#69
post #34

Earlier quoted context omitted.

Did you watch the videos linked in the article? > I'm on a 5 year old Samsung (the model is, I bought it new six months ago) How quick is the Share menu on your samsung? On mine, it takes about 3 seconds of repainting itself before it settles down. On iOS there's about a 100ms pause and the drawer pops up, fully populated. I found [0] which is a perfect example of this sort of bloat. > My main computer is beefy, thou…

No i was referring only to the comments here. The share menu comes up real fast, there's no "delay", as soon as the menu with "share" goes away, the bottom slides up and the share panel appears, icons populated. Is Slack also electron? a cursory search says discord is electron. Now, firefox lags to start, too - compared to edge, which is nearly instant to "launch". Brave is also I don't use windows terminal, i use pw…

> I think to put this to bed, we need to establish a baseline or at least a list of applications to launch while screen recording, and then literally count frames. It would be funny if this was all perception and it wasn't actually "slow", that is, "seconds to load" is actually like 2 seconds, and not 12...

2 seconds is an eternity. Its 15 round trips from London to New York, 5-8GB read from an NVMe drive, and 7 billion cpu cycles per core - with even the cheapest devices on the market having multiple cores. There’s no really any excuse for things being that slow.

Also I think that this idea that the only number that matters is the synthetic exact frame count from interaction to window for a specific list of operations is how we ended up in the scenario where windows explorer takes over a second to show the window on modern OS’s despite multiple orders of magnitude more computing power being available. Nobody really cares about what the actual performance of the running system is, as long as the exact part they’re responsible for doesn’t trip an alert.

A few years ago I worked on a project for a batch operation that was done a few hundred times a day. It took 15 minutes to run and it was starting to get in the way of things. Another team had hired 2 engineers to spin up kafka and a k8s cluster to queue these operations up, along with a reporting dashboard and metrics for queue length etc.

I ran the code through a profiler and found a hotspot on shutdown where we were searching through an array millions of times to remove a single entry, repeatedly, until the array was finished. I replaced it with a set lookup in reverse, and changed a handful of places where we rebuilt this massive array and did the same thing to use the same data structure and it dropped to under 15 seconds with about a weeks work. I identified enough other wins that would bring it under a second that would negate the need for the entire other project to exist, but it had already been approved and budget allocated for it, so last I heard they’re still taking 15 seconds and spending hundreds of thousands a month on this absolutely gargantuan monitoring system that they don’t need.

In both cases, IMO, a vision holder of “this isn’t good enough” using the product in their own device at home is what’s needed

Post reply on HN