Skip to content

Comment on P99 0 ms* autocomplete for 240M domain names

Comments

Why not just trigger the fetch on keyDown and show it as soon as the response arrives, as usual?

The time it takes to press a key is a reasonable target to aim at for API latency I suppose, but it is still an arbitrary target. Waiting to display until keyUp just adds more latency if your API is faster. Having it synced with keyUp doesn't make it feel more immediate to me.

It’s usually good to wait for user to do KeyUp before treating the string as final. A fellow commenter explained some of the reasons: https://news.ycombinator.com/item?id=49505993

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.