Live data from Hacker News

Keyboard latency

danluu.com

31–40 of 274 posts

Re: Keyboard latency

#32
post #29

Compare with musical keyboards where not only key number but also the velocity matters, so each key has two electrical contacts, and the whole thing is usually scanned around 10kHz for proper velocity measurement. Although key contacts are arranged in a diode matrix, the latency is usually below 2 ms, even with good old MIDI. So neither the keyboard matrix nor the debouncing justify a latency of 10 ms or above. It is…

Now to learn to type with a keyboard... or game I suppose.

Re: Keyboard latency

#33
post #7
post #2

IMO, a better measure would be from activation of the switch, as opposed to the beginning of key travel. I don't start waiting for the character to appear on my screen from the moment I begin to press down. My anticipation begins when I feel the tactile feedback of the switch activating (or the switch bottoming out on switches that don't offer tactile feedback). On a keyboard with good tactile feedback, I might not m…

I agree. Presumably he measured it the way he did because it's easier to measure, rather than because he thinks it's the more meaningful way. (Though maybe his way is more useful if he's interested in whether a keyboard gives an advantage in gaming, rather than whether it's pleasant to type with.)

the article specifically states the reasons for why he messured the whole travel, no guesswork needed

> This is because, as a human, you don’t activate the switch, you press the key. A measurement that starts from switch activiation time misses this large component to latency.

Re: Keyboard latency

#34

I'm surprised the "humans don't notice 100 ms" argument is even made. That's trivially debunkable with a simple blind A/B test at the command line using `sleep 0.1` with and without `sleep` aliased to `true`. To my eyes, the delay is obvious at 100 ms, noticeable at 50 ms, barely perceptible at 20 ms, and unnoticeable at 10 ms. Not to mention that 100 ms is musically a 16th note at 150 bpm. Being off by a 16th note e…

Hm, neat. I notice about the same result -- 0.1 is quite obvious.

If you want to blind A/B test yourself, run this:

    DELAY='0.1'; VALUES=(0 0); VALUES[$((RANDOM % 2))]=$DELAY; alias test_a="sleep ${VALUES[0]}"; alias test_b="sleep ${VALUES[1]}"
Adjust DELAY as you want, and then use test_a and test_b and see if you can guess which is which, then run alias to see for sure.

Re: Keyboard latency

#35
post #28

PS/2 keyboards are used by serious gamers because the scan rate is higher than USB. See https://superuser.com/questions/16893/do-usb-or-ps-2-keyboar...

The PS/2 protocol is incredibly slow. Just sending two bytes over the wire via PS/2 takes 1.3 ms.

[deleted]

Re: Keyboard latency

#36
Isn't a big part of the reason "gaming" keyboards cost so much because they can register more than three keys (sometimes four) being hit at the same time - something many cheaper keyboards cannot do due to the way they are wired?

Re: Keyboard latency

#37
post #11

Earlier quoted context omitted.

I wouldn't be surprised if the Apple keyboard is the fastest just because it has very shallow keys.

That's fine though. It's about the experience end-to-end. I love the apple keyboards. I still type faster on them than other keyboards, including high-end mechanical keyboards. The short keys and actuation feel responsive, yet I've never felt like I've accidentally triggered a key.

Agreed, and I don't understand the hate many people (seem to) have for them - the most ergonomic keyboards are those that require the least amount of repetitive motion. Not that there isn't an adjustment period, but some seem to pull out their Jump To Conclusion mats a little early.

Re: Keyboard latency

#38
post #4

Earlier quoted context omitted.

For what it's worth, that answer is now 8 years old - I'm curious if this has changed since then.

I've gotten a FTDI down to 2 ms RTT, so if done right (using isochronous transfer) you can get USB down to 1 or max 2 ms. Looking at the latencies quoted here and in the article it's certainly not the problem. Notice that just getting a thread scheduled every 2 ms is already impossible for Windows, certainly one running a game. You'll get a bunch of outliers within the second. So even if you got your keyboard down to…

>So even if you got your keyboard down to 5 ms, great, but you are not running an operating system that can reliably do something within that timespan!

Maybe I'm not understanding, but that doesn't seem correct.

Most people (gamers) are running mice at 500/1000Hz polling rates and you can easily verify the movement made in each 1-2ms update. (And it is most definitely a noticeable difference going from a standard 125Hz rate to even 500Hz.)

Re: Keyboard latency

#39

I'm surprised the "humans don't notice 100 ms" argument is even made. That's trivially debunkable with a simple blind A/B test at the command line using `sleep 0.1` with and without `sleep` aliased to `true`. To my eyes, the delay is obvious at 100 ms, noticeable at 50 ms, barely perceptible at 20 ms, and unnoticeable at 10 ms. Not to mention that 100 ms is musically a 16th note at 150 bpm. Being off by a 16th note e…

Btw your display can be the next bottle neck on 10ms scale if typical 60hz was used.

Re: Keyboard latency

#40
post #11
post #2

IMO, a better measure would be from activation of the switch, as opposed to the beginning of key travel. I don't start waiting for the character to appear on my screen from the moment I begin to press down. My anticipation begins when I feel the tactile feedback of the switch activating (or the switch bottoming out on switches that don't offer tactile feedback). On a keyboard with good tactile feedback, I might not m…

I wouldn't be surprised if the Apple keyboard is the fastest just because it has very shallow keys.

This is anecdotal so YMMV. I have a Macbook Pro 2017 and the shallow key travel makes me feel like its more accurate than the one on my previous Macbook Pro 2015 with longer key travel. Also, I feel like I am typing faster.
Post reply on HN