← Back to context

Comment by moritzwarhier

7 months ago

The delay between key press and sound starts to become noticeable at around 10ms when you play an electronic (musical) keyboard instrument.

At 20-30ms or more, it starts to make playing unpleasant (but I guess for text input it's still reasonable).

50ms+ and it starts becoming unusable or extremely unpleasant, even for low expectations.

I'm not sure how much the perception of delay and the brain lag differs between audio and visual stimuli.

But that's just about the perceived snappiness for immediate interactions like characters appearing on screen.

For events that trigger some more complex visual reaction, I'd say everything below 25ms (or more, depending on context) feels almost instant.

Above 50ms you get into the territory where you have to think about optimistic feedback.

Point that most seem to miss here is that debouncing in FE is often about asynchronous and/or heavy work, e.g. fetching search suggestions or filtering a large, visible list.

Good UIs do a lot of work to provide immediate feedback while debouncing expensive work.

A typical example: when you type and your input becomes longer with the same prefix, comboboxes don't always need to fetch, they can filter if the result set was already smallish.

If your combobox is more complex and more like a real search (and adding characters might add new results), this makes no sense – except as an optimistic update.

_Not_ debouncing expensive work can lead to jank though.

Type-ahead with an offline list of 1000+ search results can already be enough, especially when the suggestions are not just rows of text.

> 10ms when you play an electronic (musical) keyboard instrument.

Sound travels 3.4 meters in that time; if your speakers are that far away in a live situation, there is your extra 10 ms.

  • You are right about that, I was also wondering whether the numbers and categories I pulled.. chose make sense.

    I was mainly thinking about keyboards where you have at least some close exposure to a/the sound source.

    For example, organ players sure need to incorporate some intuition about the pipe sound latency into their skills (on top of the sound space and reverb!)