Tuesday, 26 December 2017

Latency: why typing on old computers just feels better

How long does it take, from keypress to the letter appearing on-screen, in a basic terminal window? My Core i7 PC with a GTX 1070 video card and 32gb of RAM might -- might -- be about as fast as 35-year-old Apple IIe. And almost nothing else is. It seems that modern computers are so complex that there are just some things they can't do quickly.

Compared to a modern computer that’s not the latest ipad pro, the apple 2 has significant advantages on both the input and the output, and it also has an advantage between the input and the output for all but the most carefully written code since the apple 2 doesn’t have to deal with context switches, buffers involved in handoffs between different processes, etc. On the input, if we look at modern keyboards, it’s common to see them scan their inputs at 100 Hz to 200 Hz (e.g., the ergodox claims to scan at 167 Hz). By comparison, the apple 2e effectively scans at 556 Hz. ...If we look at the other end of the pipeline, the display, we can also find latency bloat there. I have a display that advertises 1 ms switching on the box, but if we look at how long it takes for the display to actually show a character from when you can first see the trace of it on the screen until the character is solid, it can easily be 10 ms. You can even see this effect with some high-refresh-rate displays that are sold on their allegedly good latency.

Only one modern machine, doing one task, can keep up with the Apple IIe's keyboard latency: a second-gen iPad Pro's pencil input. Nothing else (including the iPad Pro's own keyboard) hits 30ms.

I had my own agonizing tangle with this problem. My favorite writing app, WriteRoom, is so laggy on my 12" MacBook that I just don't bother: an earlier version still shoots fast as lightning on a 2000s-vintage Snow Leopard iMac. Somewhere between Snow Leopard and Yosemite, between Core Duo and Core m3, between WriteRoom 2 and the most post-Lion versions, so much more horsepower is required draw words on the screen that a contemporary Mac is visibly slower than a decade-old one.