5 ms·
It certainly is. Most of the reason modern computers don't feel instantaneous is actually a trade-off: old computers were less adaptive to change. In old GUIs
by derefr 6y ago
It certainly is. Most of the reason modern computers don't feel instantaneous is actually a trade-off: old computers were less adaptive to change.
In old GUIs (e.g. Windows 3.1), many things—file associations, program launchers, etc.—got loaded from disk into memory once—usually at GUI startup—and then the state of those things was maintained entirely in memory, with programs that updated the on-disk state of those things either 1. also independently updating the in-memory state with a command sent to the relevant state-database-keeper; or 2. requiring that you log out and back in to see changes.
Today, we don't have everything sitting around loaded into memory—but in exchange, we have soft-realtime canonicity, where the things you see in the GUI reflect the way things are, rather than a snapshot of the way things were plus (voluntary, possibly missable/skippable) updates. Install a program that has higher-than-default-binding file associations? The files in your file manager will update their icons and launch actions, without the program needing to do anything.
There's ways to eat your cake and have it too—to have on-disk canonicity and instant updates—but this require a very finicky programming model†, so we haven't seen any GUI toolkit offer this, let alone one of the major OSes do so.
† Essentially, you'd need to turn your Desktop Environment into a monolithic CQRS/ES aggregate, where programs change the DE's state by sending it commands, which it reacts to by changing in-memory state (the in-memory aggregate), and then persists a log of the events resulting from those commands as the canonical on-disk state (with other aggregates fed from those to build OLAPable indices / domain-state snapshots for fast reload.) This gets you "Smalltalk windowing semantics, but on a Unix filesystem substrate rather than a VM memory-image substrate."
- StillBored 6y agoWhile you might be slightly right, my experience tuning windows machines leads me to believe your missing the mark. I'm going to say the three largest contributions to general desktop lag are: Animations and intentional delays. It can't be said, how much faster a machine feels when something like MenuShowDelay is decreased to 0, or the piles of animations are sped up. Too many layers between the application draw commands and the actual display. All this compositing, vsync, and minimal 2d acceleration creates a low level persistent lag. Disabling aero on a win7 machine does wonders to its responsiveness. But even then pre-vista much of the win32 GDI/drawing API was basically implemented in hardware on the GPU. If you get an old 2d win32 API benchmark, you will notice that modern machines don't tend to fare well in raw API call performance. 30 seconds poking around on youtube, should find you a bunch of comparisons like this https://www.youtube.com/watch?time_continue=25&v=ay-gqx18UTM&feature=emb_logo https://www.youtube.com/watch?time_continue=25&v=ay-gqx18UTM.... Keep in mind that even in 2020 pretty much every application on the machine is still relying on GDI (same as linux apps relying on xlib). Input+processing lag, USB is polling with a fairly slow poll interval rate (think a hundred or so ms). Combined with the fact that the keystrokes/events then end up queued/scheduled through multiple subsystems before eventually finding their way to the correct window, and then having to again reschedule and get the application to retrieve and process it via GetMessage()/etc. Basically, this is more a function of modern software bloat, where all those layers of correct architecture add more overhead than the old school get the ps2 interrupt, post a message to the active window queue, schedule the process managing the window messages. (https://social.technet.microsoft.com/Forums/windows/en-US/b18330ea-ded6-48ae-a524-da065eafaef1/changing-usb-polling-rate-x64?forum=w7itprohardware https://social.technet.microsoft.com/Forums/windows/en-US/b1...) There are a number of other issues, but you can retune those three areas to some extent, and the results are a pretty noticeable improvement. Having someone at MS/etc go in and actually focus on fixing this might have a massive effect with little effort. But that doesn't appear to be in the cards, since they appear to be more interested in telemetry and personal assistants.
- cellularmitosis 6y ago> Disabling aero on a win7 machine does wonders to its responsiveness. Tragically, it seems the only way to completely get rid of tearing in youtube is to re-enable Aero :( (at least with nvidia hardware). RIP classic.
- StillBored 6y agoI don't know if this still works, but nvidia had a "program settings" override, where you could select a .exe and force vsync on for particular programs. Might try messing with that. I did that for media player classic a long time ago.
- zozbot234 6y agoThe thing is, you will always have tearing if you disable vsync (and compositing) for the sake of low latency. But tearing is only really perceivable when watching full-screen videos and animations, which is quite a different use case from general computer use.
- blattimwind 6y ago> Animations and intentional delays. It can't be said, how much faster a machine feels when something like MenuShowDelay is decreased to 0, or the piles of animations are sped up. These animations effectively increase the input lag significantly. Even with them turned off there are extra frames of lag between a click and the updated widget fully rendering. (Everything below refers to a 60 Hz display) For example, opening a combo-box in Windows 10 with animations disabled takes two frames; the first frame draws just the shadow, the next frame the finished open box. With animations enabled, it seems to depend on the number of items, but generally around 15 frames. That's effectively a quarter second of extra input lag. A menu fading in takes about ~12 frames (0.2 seconds), but at least you can interact with it partially faded in. Animated windows? That'll be another 20 frame delay, a third of a second. Without animations you're down to six, again with some half-drawn weirdness where the empty window appears in one frame and is filled in the next. (So if you noticed pop-ups looking slightly weird in Windows, that's why). I assume these two-frame redraws are due to Windows Widgets / GDI and DWM not being synchronized at all, much like the broken redraws you can get on X11 with a compositor. > USB is polling with a fairly slow poll interval rate (think a hundred or so ms). The lowest polling rate typically used by HID input devices is 125 Hz (bInterval=8), while gaming hardware usually defaults to 500 or 1000 Hz (bInterval=2 or 1). Most input devices aren't that major a cause of input lag, although curiously a number of even new products implement debouncing incorrectly, which adds 5-10 ms; rather unfortunate. https://epub.uni-regensburg.de/40182/1/On_the_Latency_of_USB-Connected_Input_Devices_author_version.pdf https://epub.uni-regensburg.de/40182/1/On_the_Latency_of_USB...
- dialamac 6y agoNot entirely sure your analysis passes muster. While it is true pigs like chrome and slack are the norm, computers still have many orders of magnitude more memory than 20 years ago and even if a large GUI app keeps state on disk most of it should be hot in some kind of cache whether an explicit cache or just the OS page cache. There are other forces at work. For instance on my primary workstation after a period of time from cold boot, pretty much everything is sitting comfortably in 32 GB of memory. A lot of time is more due to the 1) sheer volume of crap that has to be shuttled in memory, because memory accesses still aren’t free 2) there’s a surprising amount of repetitive CPU intensive tasks just to get a program started up on merely bookkeeping tasks like linking, conversion, parsing. In addition to all the built in latencies already mentioned. To prove this you can setup a system using a RAM disk and notice that responsiveness is often still subpar.
- p_l 6y agoI strongly suspect there are issues related specifically in how not just the OS, but also various applications, handle input events. Special example for me is Chrome, which has a huge singleton in the form of Browser Process that can make your experience a hell even if all other chrome processes are idling - simply because it's the central hub that handles among other things all of Input handling and UI. This compounds with other latencies, where often I can start building patterns of "if a windows containing that kind of content is on, expect macOS WindowServer to start lagging insanely despite being under low load)
- tarsinge 6y ago> It certainly is. Most of the reason modern computers don't feel instantaneous is actually a trade-off: old computers were less adaptive to change. To the point that old Macs had most of the system routines in ROM[0]. [0]https://en.wikipedia.org/wiki/Macintosh_Toolbox https://en.wikipedia.org/wiki/Macintosh_Toolbox