p99 0ms* autocomplete for 240 million domain names
48 points by nemin
48 points by nemin
On
keyDown(the user starts pressing a key), we prefetch the suggestions for the typed character + any next character. And onkeyUp(the user releases the key), we render the suggestions.
Eww. Why wait until keyup? That’s not normal and feels bad.
For regular activation, typing or keyboard shortcuts, you should only ever use keydown. keyup is only for things like movement in games where the pressed state of a key is what has effect. Nothing else that I can think of should ever use keyup.
By contrast, regular mouse and touch activation occurs on release—typically click or mouseup or pointerup—because you can cancel activation by moving outside the control before releasing, and for touch because long press is something different on at least some platforms: on Android long press on icon-only buttons is supposed to show the label in a tooltip.
I'm confused by this article. The raw data set is 2.5GB.
I've been a professional consultant for these things for half a decade... this is "throw it at an inverted index and be done with it" territory? Most of the services I maintained responded in between 2-4ms even under substantial load.
This seems a lot of work for something relatively simple? Am I missing something?
I mean, even pessimistically - if every domain was max size (255bytes), we'd still be at just 60GB.
It's certainly fast, but apparently we've collectively forgotten what "instant" actually looks like. It's certainly not instant for me, and "next frame" isn't much when it's operating at <10 fps.
Oh, that actually works really well! Nicely done
Does the author just assume everyone uses 60Hz? They keep saying “next frame” as if that’s a clearly defined time frame