by dev0p · 4mo ago · 0 comments
Aside from the loading times, the thing is incredibly fast. I invite you to try one if you have the chance, as words don't make it justice. I can't think of anything today that comes close to how instantly it responds to user input, even iOS feels sluggish in comparison.
It had only a few kilobytes of memory, a bunch of CPU cycles and a dream, but By God they made damn sure not to waste a single instructions and it shows. We need to go back.
In case someone wants to see for themselves how "instantly" it really was. Skip to ~9:50 when it gets real sluggish.
Edit: if you don't wear nostalgia glasses, you can watch the bits of screen being redrawn piece by piece after something moves or a menu closes. Everything is flickering. Opening and closing a menu takes up to one second. The text being typed in the editor lags. This is not more responsive than a modern system, far from it. Obviously.
This does not happen on a 1985 Amiga, even with a fraction of the CPU power, which it needs all of it to redraw UI damage as seen.
The reason is that the Amiga system prioritised input processing above normal tasks, it had preemptive multitasking where hardware timers triggered a CPU interrupt to let the kernel switch to a new timeslice, and of course reading a floppy disk was done with hardware interrupts and DMA transfers because the OS knew exactly what hardware it was dealing with, while PC compatibles couldn't guarantee those transfer modes (https://wiki.osdev.org/Floppy_Disk_Controller) so Windows 95 would inevitably handle floppy drives with polling.
The flawless refresh rate comes from the fact the update is executed as part of a level 3 priority CPU interrupt triggered by the vblank refresh. Interrupt code reads the hardware register of a dedicated chip that has been measuring the mouse's potentiometers this whole time, to see how much they've moved. The mouse itself is a passive device.
It then sends a input event to Intuition, whose priority 20 input.device task (the highest priority task in any normal Amiga system) processes the event and updates the hardware sprite coordinates, but could equally write it onto the bitmap. It has the time to do that because everything else in the system waits for it.
Compared to a modern PC, which also uses a hardware cursor... the mouse is an active device and sends its own potentiometer readings as USB input events, which arrive to be processed by an independent USB subsystem in the kernel and is bundled with all the other USB traffic from devices attached on the same bus. A vblank interrupt couldn't get the mouse coordinates even if it wanted to.
Apple loved doing things in software, ever since Woz wrote the Apple II disk routines in software so their floppy drives didn't need their own controller (the Commodore machines had a whole second CPU running an operating system in theirs). This is also why the one thing that WOULD lag the cursor on a classic Mac was formatting a floppy disk, since it required interrupt-level timing.
Even to this day Apple loves running things in software - the speakers on modern Mac laptops are driven in software - macOS has a daemon that runs and adjusts the speaker volume, tracking the sound pressure sent to them to keep them from being blown out. When Asahi Linux added speaker support, they had to reimplement this from scratch.
https://www.datagubbe.se/stupidslow/
(previous discussion)
https://news.ycombinator.com/item?id=40604972
The Amiga feels fast because its slowness is predictable. Modern systems have unexpected slowness, and unexpected things are always more noticeable.
But I agree that predictable slowness is a thing. One only need to discuss traffic jams vs a 20 minute car trip without them.
The "instantly" refers to user input: clicking a button, typing, or moving the mouse was as fast as it could possibly get because of how close the OS was to the bare metal, with no fluff bogging down the experience. Simply put, there were no wasted frames, as there were none to waste. Nowadays, at the very least, you get a couple millisecond of latency. That was not the case here.
Also, this is a machine from NINETEEN EIGHTY F//G FIVE, and it's still probably faster than your average PC running Windows 11.
https://www.youtube.com/watch?v=G-e3w7Hh9eU
Also gp talks about input responsiveness (e.g. key and mouse input), and that has indeed much less latency on those old-school home computers than on modern systems where each input event goes through layers and layers of abstraction bloat before causing a visible change on the display.
Even a powerful PC, such as running WinNT or Linux on my 9800x3d, doesn't feel as tight as my pretty basic Amiga 500 does.
It's the difference between a RTOS proper (AmigaOS, QNX, BeOS) and a toy (Windows, Linux, MacOS).
It had a very simple static absolute priority scheduler and very little that could cause long pauses (like virtual memory), which made it much more predictable in scheduling than more sophisticated schedulers like in Windows, Linux, and MacOS. At one point I had an A1200 and a Linux Pentium 300-ish, and CD-writer on both systems. I could trust the Amiga to write CDs without creating a coaster every time, where the Linux box would succeed only 2/3 the time due to the unpredictable scheduling and it running the buffer dry.
So it wasn't a real RTOS, but it definitely behaved more like one that what we have now.
This is, by the way, equivalent to SCHED_FIFO on Linux.
There are very legitimate reasons a hard realtime task may need to be non-interruptable.