[HN Gopher] 300ms typo detection for 1.3M words
___________________________________________________________________
300ms typo detection for 1.3M words
Author : todsacerdoti
Score : 49 points
Date : 2024-09-09 16:44 UTC (6 hours ago)
(HTM) web link (trieve.ai)
(TXT) w3m dump (trieve.ai)
| underyx wrote:
| Title:
|
| > 300ms typo correction for 1.3M words
|
| Article:
|
| > 300ms for correctly spelled queries and ~5ms/word for
| misspellings
|
| Aren't these contradictory?
| skeptrune wrote:
| The important number that changed here was the 30ms to 300ms
| for correctly spelled queries. 30ms for typos wasn't something
| that we considered a problem and improving to ~5ms was really a
| side benefit of fixing things for the correct spellings.
|
| Additional latency for actual typos seems ok, but degradation
| for correctly spelled queries felt really bad. The thing that
| was really damaging to the UX for us was when latency was
| spiking for search queries where it didn't need to.
| underyx wrote:
| Sure, but why does the title claim 300ms typo correction?
| skeptrune wrote:
| Agreed. Confirming correct spellings is the basecase of the
| system and what the title is referring to, but that's not
| clear.
| dang wrote:
| That's a good point, so we did a s/correct/detect/ on the
| title above. Thanks!
| orlp wrote:
| The title says 300ms typo _detection_.
|
| How? If the query doesn't finish in 300ms, return error :)
| claytonwramsey wrote:
| It's a little odd that they're using `lazy_static` now that
| OnceCell and LazyLock are in the standard library.
| skeptrune wrote:
| Yeah... We might still be kinda rust noobs lol. Should clean
| that up.
| chucksmash wrote:
| It's not that weird considering LazyLock has only been in
| stable Rust since 1.80.0, which is only ~6 weeks old!
|
| It's a great tip though. As an out of the loop/casual Rust
| programmer who has internalized using `lazy_static!` for this
| purpose, I probably never would have noticed this update short
| of lazy_static throwing compiler warnings directing me to use
| the std lib equivalents (so...maybe never?).
___________________________________________________________________
(page generated 2024-09-09 23:00 UTC)