rschmitt / heatseeker

A high-performance Selecta clone, written in Rust.
MIT License
214 stars 10 forks source link

Retain the internal state of the scoring algorithm for each match #2

Closed rschmitt closed 9 years ago

rschmitt commented 9 years ago

Since the common case consists of appending characters to the query, it makes sense to annotate the matches with additional state information (essentially the index of the last matched character, as of the last query performed). This will enable incremental scoring, instead of computing scores from scratch for a given string.

rschmitt commented 9 years ago

I'm starting to think that this might not be worth it. The changes would be quite complex (it would actually be necessary to score all matches--or at least all initial characters--not just the last best match), and once #4 is done further performance enhancements will probably be redundant.

rschmitt commented 9 years ago

I'm not going to bother with this. Heatseeker can already handle over a million choices now.