Live data from Hacker News

Fast machines, slow machines (2023)

jmmv.dev

31–40 of 72 posts

Re: Fast machines, slow machines (2023)

#31
post #9
post #3

Are mobile devices slow/unresponsive. I haven't experienced that unless I realllllly cheap out. Or after 4 years of OS updates on Apple devices for some reason. Androids seem OK in this regard.

I switched from android back to iOS last year. There seems to be some sort of inherent latency in either android or Samsung’s UI that causes the UI thread to lag behind your inputs by a noticeable amount, and for the UI thread to block app actions in many cases. Things like summoning a keyboard causing my 120hz galaxy phone to drop to sub 10fps playing the intro animation for GBoard were just rampant. All non existen…

I begin to wonder if all the commenters in this thread have compromised devices. I'm on a 5 year old Samsung (the model is, I bought it new six months ago) - my Linux machines are fast (gentoo) and my windows 10 and 11 machines are fast. My kid's computer is an i3 7350k and he plays roblox, Minecraft, teardown on it with no issues. That computer is a couple years older than he is at 9-10 years old. That computer's twin is my nas backup with 10gbe running windows - the drive array refused to work at any decent speed on Linux and I didn't want jbod, I wanted RAID.

Some things are slow, like discord on windows takes ~12 seconds before it starts to pop in ui elements after you double click. My main computer is beefy, though, 32 thread 128GB; but no NVMe. Sata spindle and SSDs. But I have Ryzen 3600s that run windows 11 fine.

Re: Fast machines, slow machines (2023)

#32
post #7

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. Unity is locked to a horrifically ancient version of mono and still manages to do a lot of work in a small period of time. (If we start talking JavaScript or python on the other h…

> incrementally async load 500 icon or text files and have them run through all the same slowness” This really shouldn't be slower when done asynchronously compared to synchronously. I would expect, actually, that it would be faster (all available cores get used).

> 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 paths)
    {
        var results = new List();
        foreach(var path in paths) {
            var f = await load_file(path);
            results.Add(ImageFile(f));
        }
        return results;
    }
and provides it with 2 files instead of 1, you won't notice it. Over time 2 becomes 10, and 10 becomes 500. You're now at the mercy of whatever is running your tasks. If you yield alongside await [0] in an event loop, you introduce a loop iteration of latency in proceeding, meaning you've now introduced 500 loops of latency.

In case you say "but that's bad code", well yes, it is. But it's also very common. When I was reading for this reply, I found this stackoverflow [0] post that has exactly this problem.

[0] https://stackoverflow.com/questions/5061761/is-it-possible-t...

Re: Fast machines, slow machines (2023)

#33
post #7

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. Unity is locked to a horrifically ancient version of mono and still manages to do a lot of work in a small period of time. (If we start talking JavaScript or python on the other h…

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 thin wrappers that spend most of our time FFI’ing things to native languages, and then deploy them in non perfect conditions you get the mess we’re in now.

Re: Fast machines, slow machines (2023)

#34
post #9

Earlier quoted context omitted.

I switched from android back to iOS last year. There seems to be some sort of inherent latency in either android or Samsung’s UI that causes the UI thread to lag behind your inputs by a noticeable amount, and for the UI thread to block app actions in many cases. Things like summoning a keyboard causing my 120hz galaxy phone to drop to sub 10fps playing the intro animation for GBoard were just rampant. All non existen…

I begin to wonder if all the commenters in this thread have compromised devices. I'm on a 5 year old Samsung (the model is, I bought it new six months ago) - my Linux machines are fast (gentoo) and my windows 10 and 11 machines are fast. My kid's computer is an i3 7350k and he plays roblox, Minecraft, teardown on it with no issues. That computer is a couple years older than he is at 9-10 years old. That computer's tw…

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, though, 32 thread 128GB; but no NVMe. Sata spindle and SSDs. But I have Ryzen 3600s that run windows 11 fine.

My main computer is a 24 core i9 with 64GB ram on NVMe. It runs windows fine. But, I saw exactly the same behaviour out of the box on this machine (and on the machine I replaced) as the linked article shows. I can compile, play games, do AV transcoding. But using apps like slack or discord is like walking through molasses, and even launching lightweight apps like WIndows Terminal, and Notepad have a noticeable delay from button press to the window appearing on screen. There's just something a bit broken about it.

[0] https://www.androidpolice.com/2018/05/05/google-please-fix-a...

Re: Fast machines, slow machines (2023)

#35
post #11

More than CPU speed, I think the increase in storage and RAM is to blame for the slow decay in latency. When you have only a few Kb/Mb of RAM and storage, you can't really afford to add much more to the software than what is the core feature. Your binary need to be small, which lead to faster loading in RAM, and do less, which means less things to run before the actual program. When size is not an issue, it's harder…

It's also complexity - added more than necessary, and @ a faster pace than hardware can keep up with. Take font rendering: in early machines, fonts were small bitmaps (often 8x8 pixels, 1 bit/pixel), hardcoded in ROM. As screen resolutions grew (and varied between devices), OSes stored fonts in different sizes. Later: scalable fonts, chosen from a selection of styles / font families, rendered to sub-pixel accuracy, s…

> But it also makes rendering each single character a lot more complex.

Not millions of times more complex.

Except for some outliers that mess up everything (like anything from Microsoft), almost all of the increased latency between keypress and character rendering we see on modern computers comes from optimizing for modularity and generalization instead of specialized code for handling the keyboard.

Not even our hardware reacts fast enough to give you the latency computers had in the 90s.

Re: Fast machines, slow machines (2023)

#37
post #9
post #3

Are mobile devices slow/unresponsive. I haven't experienced that unless I realllllly cheap out. Or after 4 years of OS updates on Apple devices for some reason. Androids seem OK in this regard.

I switched from android back to iOS last year. There seems to be some sort of inherent latency in either android or Samsung’s UI that causes the UI thread to lag behind your inputs by a noticeable amount, and for the UI thread to block app actions in many cases. Things like summoning a keyboard causing my 120hz galaxy phone to drop to sub 10fps playing the intro animation for GBoard were just rampant. All non existen…

FWIW I updated my phone to a relatively budget samsung recently, and had a similar noticeable delay to bring up the keyboard, installing 'simple keyboard' from F-droid seems to have helped. I wouldn't be surprised if it is missing features compared to the samsung/google ones where their absence will annoy a power user, but for whatever subset I use it works fine and doesn't appear as though my phone hangs.

Re: Fast machines, slow machines (2023)

#38
post #21
post #7

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. Unity is locked to a horrifically ancient version of mono and still manages to do a lot of work in a small period of time. (If we start talking JavaScript or python on the other h…

> Unity is locked to a horrifically ancient version of mono and still manages to do a lot of work in a small period of time Unity is the great battery killer! The last example I remember is that I could play the first xcom remake (which had a native mac version) on battery for 3-4 hours, while I was lucky to get 2 hours for $random_unity_based_indie with less graphics.

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

Re: Fast machines, slow machines (2023)

#40
Wasn't there some common Windows 10 bug a while back where Command Prompt would take forever to load because of DNS lookups or some crap?

These days you aren't just opening a 64k executable (notepad), you're calling back to the mothership, recording usage data, blah blah

Post reply on HN