←back to thread

837 points turrini | 2 comments | | HN request time: 0s | source
Show context
titzer ◴[] No.43971962[source]
I like to point out that since ~1980, computing power has increased about 1000X.

If dynamic array bounds checking cost 5% (narrator: it is far less than that), and we turned it on everywhere, we could have computers that are just a mere 950X faster.

If you went back in time to 1980 and offered the following choice:

I'll give you a computer that runs 950X faster and doesn't have a huge class of memory safety vulnerabilities, and you can debug your programs orders of magnitude more easily, or you can have a computer that runs 1000X faster and software will be just as buggy, or worse, and debugging will be even more of a nightmare.

People would have their minds blown at 950X. You wouldn't even have to offer 1000X. But guess what we chose...

Personally I think the 1000Xers kinda ruined things for the rest of us.

replies(20): >>43971976 #>>43971990 #>>43972050 #>>43972107 #>>43972135 #>>43972158 #>>43972246 #>>43972469 #>>43972619 #>>43972675 #>>43972888 #>>43972915 #>>43973104 #>>43973584 #>>43973716 #>>43974422 #>>43976383 #>>43977351 #>>43978286 #>>43978303 #
_aavaa_ ◴[] No.43972050[source]
Except we've squandered that 1000x not on bounds checking but on countless layers of abstractions and inefficiency.
replies(6): >>43972103 #>>43972130 #>>43972215 #>>43974876 #>>43976159 #>>43983438 #
Gigachad ◴[] No.43972215[source]
Am I taking crazy pills or are programs not nearly as slow as HN comments make them out to be? Almost everything loads instantly on my 2021 MacBook and 2020 iPhone. Every program is incredibly responsive. 5 year old mobile CPUs load modern SPA web apps with no problems.

The only thing I can think of that’s slow is Autodesk Fusion starting up. Not really sure how they made that so bad but everything else seems super snappy.

replies(40): >>43972245 #>>43972248 #>>43972259 #>>43972269 #>>43972273 #>>43972292 #>>43972294 #>>43972349 #>>43972354 #>>43972450 #>>43972466 #>>43972520 #>>43972548 #>>43972605 #>>43972640 #>>43972676 #>>43972867 #>>43972937 #>>43973040 #>>43973065 #>>43973220 #>>43973431 #>>43973492 #>>43973705 #>>43973897 #>>43974192 #>>43974413 #>>43975741 #>>43975999 #>>43976270 #>>43976554 #>>43978315 #>>43978579 #>>43981119 #>>43981143 #>>43981157 #>>43981178 #>>43981196 #>>43983337 #>>43984465 #
tjader ◴[] No.43972294[source]
I just clicked on the network icon next to the clock on a Windows 11 laptop. A gray box appeared immediately, about one second later all the buttons for wifi, bluetooth, etc appeared. Windows is full of situations like this, that require no network calls, but still take over one second to render.
replies(4): >>43973061 #>>43973911 #>>43973999 #>>43975898 #
Cthulhu_ ◴[] No.43973061{4}[source]
It's strange, it visibly loading the buttons is indicative they use async technology that can use multithreaded CPUs effectively... but it's slower than the old synchronous UI stuff.

I'm sure it's significantly more expensive to render than Windows 3.11 - XP were - rounded corners and scalable vector graphics instead of bitmaps or whatever - but surely not that much? And the resulting graphics can be cached.

replies(3): >>43974741 #>>43974846 #>>43981230 #
vel0city ◴[] No.43974741{5}[source]
Windows 3.1 wasn't checking WiFi, Bluetooth, energy saving profile, night light setting, audio devices, current power status and battery level, audio devices, and more when clicking the non-existent icon on the non-existent taskbar. Windows XP didn't have this quick setting area at all. But I do recall having the volume slider take a second to render on XP from time to time, and that was only rendering a slider.

And FWIW this stuff is then cached. I hadn't clicked that setting area in a while (maybe the first time this boot?) and did get a brief gray box that then a second later populated with all the buttons and settings. Now every time I click it again it appears instantly.

replies(2): >>43976317 #>>43981060 #
tjader ◴[] No.43976317{6}[source]
But is this cache trustworthy or will it eventually lead you to click in the wrong place because the situation changed and now there's a new button making everything change place?

And even if every information takes a bit to figure out, it doesn't excuse taking a second to even draw the UI. If checking bluetooth takes a second, then draw the button immediately but disable interaction and show a loading icon, and when you get the blutooth information update the button, and so on for everything else.

replies(2): >>43976371 #>>43980021 #
vel0city ◴[] No.43976371{7}[source]
As someone who routinely hops between WiFi networks, I've never seen a wrong value here.

And OK, we'll draw a tile with all the buttons with greyed out status for that half second and then refresh to show the real status. Did that really make things better, or did it make it worse?

And if we bothered keeping all that in memory, and kept using the CPU cycles to make sure it was actually accurate and up to date on the click six hours later, wouldn't people then complain about how obviously bloated it was? How is this not a constant battle of being unable to appease any critics until we're back at the Win 3.1 state of things with no Bluetooth devices, no WiFi networks, no dynamic changing or audio devices, etc?

And remember, we're comparing this to just rendering a volume slider which still took a similar or worse amount of time and offered far less features.

replies(2): >>43976427 #>>43979016 #
ndriscoll ◴[] No.43979016{8}[source]
Rendering a volume slider or some icons shouldn't take half a second, regardless. e.g. speaking of Carmack, Wolfenstein: Enemy Territory hits a consistent 333 FPS (the max the limiter allows) on my 9 year old computer. That's 3 ms/full frame for a 3d shooter that's doing considerably more work than a vector wifi icon.

Also, you could keep the status accurate because it only needs to update on change events anyway, events that happen on "human time" (e.g. you plugged in headphones or moved to a new network location) last for a practical eternity in computer time, and your pre-loaded icon probably takes a couple kB of memory.

It seems absurd to me that almost any UI should fail to hit your monitor's refresh rate as its limiting factor in responsiveness. The only things that make sense for my computer to show its age are photo and video editing with 50 MB RAW photos and 120 MB/s (bytes, not bits) video off my camera.

replies(1): >>43979470 #
vel0city ◴[] No.43979470{9}[source]
It's not the drawing an icon to a screen that takes the half second, it's querying out to hardware on driver stacks designed for PCI WiFi adapters from the XP era along with all the other driver statuses.

It's like how Wi-Fi drivers would cause lag from querying their status, lots of poorly designed drivers and archaic frameworks for them to plug in.

And I doubt any hardware you had when Wolfenstein:ET came out rendered the game that fast. I remember it running at less than 60fps back in '03 on my computer. So slow, poorly optimized, I get better frame rates in Half Life. Why would anyone write something so buggy, unoptimized, and slow?!

replies(1): >>43979484 #
ndriscoll ◴[] No.43979484{10}[source]
You don't need to query the hardware to know the network interface is up. A higher level of the stack already knows that along with info like addresses, routes, DNS servers, etc.

IIRC it ran at 76 fps (higher than monitor refresh, one of the locally optimal frame rates for move speed/trick jumps) for me back then on something like an GeForce FX 5200? As long as you had a dedicated GPU it could hit 60 just fine. I think it could even hit 43 (another optimal rate) on an iGPU, which were terrible back then.

In any case, modern software can't even hit monitor refresh latency on modern hardware. That's the issue.

replies(1): >>43979528 #
vel0city ◴[] No.43979528{11}[source]
It's not just showing "is the interface up", it's showing current signal strength, showing current ssid, showing results from the recent poll of stations, etc.

And then doing the same for Bluetooth.

And then doing the same for screen rotation and rotation lock settings. And sound settings, And then another set of settings. And another set of settings. All from different places of the system configuration while still having the backwards compatibility of all those old systems.

It's not a slowness on painting it. It can do that at screen refresh rates no problem. It's a question of querying all these old systems which often result in actual driver queries to get the information.

43fps? Sure sounds slow to me. Why not 333fps on that hardware? So bloated, so slow.

replies(1): >>43979573 #
ndriscoll ◴[] No.43979573{12}[source]
You're just listing mechanisms for how it might be slow, but that doesn't really make it sensible. Why would the OS query hardware for something like screen rotation or volume? It knows these things. They don't randomly change. It also knows the SSID it's connected to and the results of the last poll (which it continuously does to see if it should move).

And yes it should cache that info. We're talking bytes. Less than 0.0001% of the available memory.

Things were different on old hardware because old hardware was over 1000x slower. On modern hardware, you should expect everything to be instantaneous.

replies(1): >>43979734 #
vel0city ◴[] No.43979734{13}[source]
And yet doing an ipconfig or netsh wlan show interfaces isn't always instantaneous depending on your hardware and the rest of your configuration. I can't tell you what all it's actually doing under the hood, but I've definitely seen variations of performance on different hardware.

Sometimes the devices and drivers just suck. Sometimes it's not the software's fault it's running at 43fps.

I'm hitting the little quick settings area on my exceptionally cheap and old personal laptop. I haven't experienced that slowness once. Once again I imagine the other stuff running interrupting all the OS calls and what not loading this information causes it to be slow.

replies(1): >>43984020 #
1. dijit ◴[] No.43984020{14}[source]
I don't know what operating system you're talking about, but the bottleneck on my linux machine for asking for interfaces is the fact that stdout is write blocking.

I routinely have shy of 100 network interfaces active and `ip a` is able to query everything in nanoseconds.

replies(1): >>43985895 #
2. vel0city ◴[] No.43985895[source]
Considering this whole conversation is about sometimes some people have a little bit of slowness drawing the quick settings area in Windows 11 and I gave commands like "netsh" it should be pretty dang obvious which OS we're talking about. But I guess some people have challenges with context clues.

And once again, on some Linux machines I've had over the years, doing an ip a command could hang or take a while if the device is in a bad state or being weird. It normally returns almost instantly, but sometimes has been slow to give me the information.