Live data from Hacker News

Keyboard latency

danluu.com

181–190 of 274 posts

Re: Keyboard latency

#181

"It all started because I had this feeling that some old computers feel much more responsive than modern machines." s/modern/recent/ "For example, an iMac G4 running macOS 9 or an Apple 2 both feel quicker than my 4.2 GHz Kaby Lake system." Kaby Lake system running OSX? I have one of the last G4 that came with OS9. Based on intuition it would make audio applications "feel" slower, when OSX came out I did not "upgrade…

"... a fraction of what they paid."

Strike that. Obviously computers were far more expensive in decades past and the prices have come down dramatically. What I meant is a first user with an older computer who is achieving better performance, e.g. lower latency, than a second user having the costs of acquiring the latest hardware and software (who discarded her older computers).

Re: Keyboard latency

#182
On linux, after keyboard has decided that a key has been pressed, and is ready to tell USB about it.

1. Wait for USB to poll.

2. Handle interrupt urb generated by keyboard.

3. Propagate the urb to the correct driver for completion

4. Create input events for each key event in this urb. Don't forget to use this to add to your randomness pool!

5. Pass the key event to user space, and wake up readers.

6. Some library reads the input event, and calls some sort of handler.

7. Application logic updates the internal state as a result of a key press.

8. Tells some library to redraw.

9. Library redraws, and writes to the X server using x protocol.

10. Magic occurs. I assume this magic is mostly just compositing windows and copying to a frame buffer, but who knows?

11. The magic pixies run across the wire from your PC to your monitor, and at some future date, your monitor displays it.

Honestly, I am impressed that all of this gets done in less than 100ms.

Re: Keyboard latency

#183
post #157

Earlier quoted context omitted.

"the most ergonomic keyboards are those that require the least amount of repetitive motion" Not sure I can agree with that. I was using one of the Apple keyboards for quite a long time while running liveops on an online game (which meant rapid response whenever incidents happened, jumping into shells and constantly typing like my life depended on it), and developed fairly severe wrist problems within a couple months.…

Ditto, after a bad strain injury on my wrist I bought a Kinesis. I don't think I could really use a computer without it. For me though it's mostly wrist angle; while I love the tactile mechanical switches I don't think the impact is a huge factor unless you are prone to pressing very hard on a scissor switch or a linear switch.

I seem to recall the old IBM keyboard was designed it way it was to provide tactile and auditory feedback that the input had been registered before the key bottomed out. This to reduce long term strain injuries. After all, the primary use of a computer back then would be writing. Be it codes or reports.

Re: Keyboard latency

#184
post #26

Has anyone benchmarked the keyboard latency of recent generations MacBook Pro Retinas?

Macbooks are known to throttle usb polling to something like 32ms toi save battery.

Re: Keyboard latency

#185

I've done a simple test with my Macbook Air, using the app "Is It Snappy", as mentioned in the comments. I used the keyboard on my macbook, which is a chiclet style mechanism. The tests were all done in triplicate except for TextEdit, (only twice) TextEdit: ~81 ms from key depression to when LCD pixels begin to shift. For Sublime Text: ~86 ms. Both of these text editors are pretty well matched. However, if you boot i…

try with charger plugged in, macs throttle polling to save power.

Re: Keyboard latency

#186

I probably missed something but: > It’s possible to get down to the 50ms range in well optimized games with a fancy gaming setup, and there’s one particularly impressive consumer device that can easily get below that. Is the device in question mentioned anywhere?

Not mentioned in the post, but I worked with Dan on this and I'm pretty sure he's talking about the iPad pro.

Re: Keyboard latency

#187

Completely missing the fact that enthusiast keyboards still prefer PS/2 for NKRO (no key-rollover) and HW interrupt support which results in sub 10ms delays.

NKRO is N-key rollover, as opposed to 2-key rollover (limited to pressing 2 keys at once) - N meaning any number

Re: Keyboard latency

#188

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…

Absolutely. In a past life I was a hardcore Quake 1 gamer...which, ahead of its time, had a way to adjust 'ping' for fairness. Any thing above 15 or 20 was noticeable...at 100 it was awful.

Re: Keyboard latency

#189
post #185

I've done a simple test with my Macbook Air, using the app "Is It Snappy", as mentioned in the comments. I used the keyboard on my macbook, which is a chiclet style mechanism. The tests were all done in triplicate except for TextEdit, (only twice) TextEdit: ~81 ms from key depression to when LCD pixels begin to shift. For Sublime Text: ~86 ms. Both of these text editors are pretty well matched. However, if you boot i…

try with charger plugged in, macs throttle polling to save power.

That's only true if your battery is low, and mine was above 80%

Re: Keyboard latency

#190
post #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.

Chorded keyboards are a thing aleardy. It should be possible to type quite efficiently using a musical keyboard.
Post reply on HN