The latency problem: why modern gaming PCs are slower than an Apple II

How fast is your PC? Is it as quick as an Apple IIe? Surely it's faster, thanks to gigahertz of multicore processing power that dwarfs the Apple II's 1.023 MHz. And yet, in some ways, maybe not. Today's PCs wield supercomputer levels of power by the standards of the Apple II, which was first released in 1983. But in terms of pure responsiveness, the time between hitting a key and seeing a result pop up on a monitor, an old computer can feel surprisingly quicker. 

Keyboards are often more powerful than entire computers from the 70s and 80s! And yet, the median keyboard today adds as much latency as the entire end-to-end pipeline as a fast machine from the 70s.

Dan Luu

"I've had this nagging feeling that the computers I use today feel slower than the computers I used as a kid," former Google and Microsoft computer engineer Dan Luu recently wrote on his website. Concerned that his suspicion was a quirk of human perception, Luu started to use a high-speed camera to measure latency on the computers around him, and he found something surprising. New computers really are slower. His Apple IIe clocked in at 30ms between hitting a key and seeing a character pop up on its screen. His 2016 Thinkpad X1 Carbon, running Windows on a Core i7-6500U, clocked in at 150ms. Two other new computers, including a gaming PC, scored much better, but were still double his Apple IIe's speed, and in general he noticed that the more recent the device, the slower it tended to respond.

Thanks to his engineering background, Luu understands the reasons behind that slower responsiveness, and they essentially boil down to complexity. When he tested his Apple IIe it was running nothing but its terminal interface; it wasn't simultaneously connected to the web, rendering TrueType fonts, running anti-virus software and all the other things that a modern PC tends to be doing: playing music, uploading files to Dropbox, downloading Windows updates, running chat software and Steam.

But the fundamental question of why input latency has been a casualty in the race to make computers more convenient and powerful is fascinating. After his initial tests, Luu was hooked. He test tested a series of keyboards for latency and discovered a wide range of response times. It turns out the simple, trusty keyboard is the perfect case study for why today's PCs respond more slowly than computers made nearly 40 years ago.

"Keyboards are often more powerful than entire computers from the 70s and 80s!" Luu wrote. "And yet, the median keyboard today adds as much latency as the entire end-to-end pipeline as a fast machine from the 70s."

At the top end of his testing was an Apple Magic Keyboard (connected via USB) at 15ms. At the bottom was a 2012 wireless Logitech K360 at 60ms. "Most keyboards add enough latency to make the user experience noticeably worse, and keyboards that advertise speed aren't necessarily faster," Luu wrote. And here's the thing: two of the keyboards were marketed for gaming, the Razer Ornata Chroma (35ms) and Easterntimes i500 (50ms).

So what does that mean for the modern PC gamer? Is this indicative of a crisis? What should we expect from our mice and keyboards? What's going on under those plastic (and metal) cases? The answer, well, it's complicated.

A sampling of computer latency tests via Dan Luu.

The causes of keyboard latency

A lot happens when you press a key on your keyboard. The essential process is the same in both a soft-feeling membrane keyboard or a clicky mechanical one. When their keys are depressed and an electrical connection is made, a signal works its way through to a microprocessor inside the keyboard, which then sends a message to the USB controller in your computer, where it's then picked up by Windows, which then sends it on to the game or application you're running. And then an image reflecting the change you made has to be rendered and sent to a display to be turned into dots of light. Every single one of these events imposes a delay, and thus latency is impossible to avoid.

We all feel latency on some level or other, though we're maybe less sensitive to it than you might think. In Usability Engineering, a 1993 book which has helped define what computers aim to achieve, usability and user interface consultant Jakob Nielsen wrote that a delay of "0.1 second is about the limit for having the user feel that the system is reacting instantaneously". That's 100ms.

Yet we're able to detect fluctuations in latency of as little as 16ms, according to a study at NASA Ames Research Center. And another study into mouse latency showed that people began to make more accuracy errors when pointing at a target as latency crept above 83ms. So in terms of comfort and precision, latency is important. 

The causes of input latency swirl around with a lot of misinformation and misunderstanding.

For game developers, it's a fact of life. And for developers like 7th Beat Games' Hafiz Azman, it's especially crucial. Azman is making Rhythm Doctor, an anarchic, sense-frying one-button rhythm game, and he has had to compensate for latency throughout its design. "Rhythm Doctor has pretty small error margins, plus or minus 0.07 seconds [70ms]," he says. "So like most rhythm games, we need calibration tools that can offset your inputs correctly, otherwise you'd have to play by pressing before the beat in order to have your input be detected on the beat."

Azman has studied the contrasting ways other rhythm games have approached latency, such as Guitar Hero, and Nintendo's superb Rhythm Heaven for DS. Rhythm Heaven plays it simply: you hear the 'correct timing' sound if you press the button within its accepted margin. 

"In Guitar Hero, on the other hand, if you try playing notes correctly and then deliberately miss a note, you'll still hear the initial pluck of that note at the right time, and then a moment later that note will mute, and the 'wrong note' sound will play over it," he says. The difference is because Harmonix had to ensure Guitar Hero would be playable on a range of TVs and sound systems, each with their own latencies, while Nintendo knew the exact hardware latencies the DS would impose.

Rhythm Doctor largely uses the Guitar Hero approach. "Windows has a huge audio latency," Azman says, but in some levels the game plays a 'hit confirm' sound one beat after the note in order to sidestep latency. "It will still sound in time with the music because it happens on a downbeat, and can give more of a sense of reward to the player."

Input latency isn't such an issue for preset level design like Rhythm Doctor, because Azman can offset inputs to account for it. It's a bigger deal in games where the action dynamically emerges during play, such as FPSes. Still, 7th Beat Games' programmer Giacomo Preciado made us a tool so you can experience the spectrum of input latency for yourself. Use the spacebar to start and jump; use cursor right and left to change the latency of your movements:

Click the image to jump to the playable latency demo!

Click the image to jump to the playable latency demo!

The causes of input latency swirl around with a lot of misinformation and misunderstanding. You may have heard about polling rates, debouncing and scan rates. They all affect latency, but often not in the simple ways in which they're often marketed, and the biggest sources of latency are often somewhere else entirely.

In a keyboard, the first point of latency comes from a simple fact about electrical switches. When a contact is formed, there's a period during which the electrical signal sharply fluctuates before stabilising. Because of this, a keyboard will wait until it's sure that the signal is stable before triggering a keypress so it's sure it was intended. This is process is called debouncing, and it typically imposes a 5-20ms delay when a key is pressed. "Everyone's got a different algorithm, some are very similar and they all go at different speeds," says Chris Pate, senior product manager for Logitech's gaming division. "That's one of the things you need to do to make sure the microprocessor in the device is sending accurate data." 

In other words, debouncing is important, and while you can reduce the delay it generally comes with a tradeoff: "You're balancing phantom or incorrect inputs versus speed, so we basically go as fast as possible without putting our users at risk of phantom or incorrect data," says Pate.

Custom keyboard designer Matteo Spinelli, who's behind the WhiteFox, says every kind of keyboard switch has a slightly different debounce time. With Cherry MX switches it's 5ms, which is a reasonable figure to expect for gaming hardware, while Cherry's RealKey technology claims 1ms. 

Some of the biggest delays in a keyboard can simply be in the mechanical action of pressing down the key.

After debouncing, the next little wait relates to the keyboard's scan time, the rate at which it updates an index of the state of every key. The scan time usually runs no faster than the debouncing speed, and if you hit a key just after a scan has started, the keyboard won't pick it up until the the next scan has started, which for keyboard with a 5ms debounce can impose an extra 10ms. Interestingly, Luu says that the Apple IIe's keyboard scan rate is much faster—50kHz compared to the 200Hz that a 5ms debounce time theoretically achieves—so it picks up new key presses in a matter of microseconds rather than milliseconds.

And then there's polling rate, which is a common term that's often used to indicate how quickly a device responds to an input. But really it's the speed at which the USB controller checks to see if the keyboard – or mouse – has something new to report. And you should basically just go for one speed: 1000Hz. "Everything else that you read on keyboard packaging is mostly a gimmick," says Spinelli.

The Whitefox mechanical keyboard

1000Hz is USB's full-speed rate, a figure set all the way back in August 1998 when USB 1.1 was released. It means that the USB controller is checking the keyboard or mouse for changes every 1ms. "Realistically, there's been no need to improve the data and report rate capabilities of HID [USB human-interface device] gear since then," says Pate. "You can increase the speed at the potential detriment of the experience for little to no gain, just because you want to, right? Some people do liquid nitrogen overclocking because it's fun, and the goal is to see how long it takes before the OS crashes so it's not a very useful computer. A 1ms polling rate is very well understood, it's well established, it's well worked with."

That's USB, but your keyboard can go faster using the much older PS/2 interface, which sends signals to the host computer immediately. But as Pate says, you'd be dropping the convenience of USB, which delivers power, sends data both ways and plugs in anywhere. "PS/2 has a very dedicated and happy enthusiast following for reasons that do not matter to most consumers," says Pate. "I'm happy they're happy and their rationale is entirely correct, and for most people non-meaningful."

And besides all that, some of the biggest delays in a keyboard can simply be in the mechanical action of pressing down the key. Mechanical keyboards can feel more responsive because you feel the point of actuation, and you also don't have to push the key so far. "For 4mm travel on both keys, the mechanical switch will usually actuate at 2mm while a membrane will be at 4mm because you have to push it all the way down," says Pate. "The time it takes to go that extra 2mm is far longer than any kind of processing difference could be."

The keyboard is just the start

Once the signal leaves the keyboard we're into software, and far fuzzier territory. "You can certainly optimize your [firmware] code to come as close as possible to the hardware limit or sometimes to circumvent or trick it," says keyboard designer Spinelli. But he recognises that it's often pretty impractical for a typical gamer, since optimizing firmware means tailoring it to your specific machine. There's room to improve on manufacturers' firmware, which has to cater to everyone, but you need to be a technical whiz to do it. 

Or you could buy a custom keyboard, which Spinelli perhaps inevitably advises. Mainstream ones, he says, may be running macros and LED light displays and other bits and pieces. "How can you tell what a Razer or a Cooler Master or a Corsair is doing? Don't risk it, take the most plain keyboard you can find. Avoid backlights, displays, cellphone docks and all that shit," he says. For him, hardware built on open source software is the way to go, projects like his own WhiteFox, which uses a dedicated thread for backlight so that it doesn't interfere with its response time.

A mechanical keyboard in assembly via The Wirecutter's Kimber Streams.

Pate takes a more measured view. He says firmware plays a big role in ensuring a keyboard or mouse is reporting reliably, and that, along with speed, is what his products are tuned for. But he says that features like lights can absolutely slow a device's response time. "There are products on the market, which are not Logitech, that respond measurably more slowly if you play a bunch of lighting effects. So it's a matter of proper design. If you're making a performance device, you start with that and don't do things that inhibit it."

Your keyboard is just the start of a chain of events that will end up with the letter you pressed appearing on your screen, and the delay it imposes is not likely to be the longest in that chain. Windows and your game will impose their own latencies and then, even if you're running it at 60FPS, that refresh rate will be adding yet another 17ms per frame—and then there's your display's internal processing time… After decades of advancement, complexity has paradoxically made our computers slower, even as they simultaneously get faster.

"It's a bit absurd that a modern gaming machine running at 4,000x the speed of an Apple II, with a CPU that has 500,000x as many transistors (with a GPU that has 2,000,000x as many transistors) can maybe manage the same latency as an apple II in very carefully coded applications if we have a monitor with nearly 3x the refresh rate," wrote Luu. There is a silver lining, at least: some very dedicated hardware and software are pushing those latency numbers downward, though many "gaming" products still aren't as fast as keyboards and monitors from the 1970s. Ironically, it's taken a whole lot more complexity to even get close.