Skip to content

[Performance] Incremental Fuzzy Search #80

@yashksaini-coder

Description

@yashksaini-coder

Goal

Achieve near-zero latency search by reusing previous results when the query grows.

Description

Currently, every keystroke triggers a full re-scan of all packages. When a user types "gi" after "g", the new results are always a subset of the previous ones.

Implement incremental search:

  1. Cache the last search results along with the query that produced them
  2. If the new query is a prefix extension of the previous query (e.g., "g"→"gi"→"git"), run the fuzzy scorer only against the previous result set instead of all packages
  3. If the new query diverges (different prefix or shorter than previous), fall back to full re-scan

This optimization should be transparent to the rest of the app. The logic lives in src/ui/app.rs where searches are dispatched.

Tech

Rust, Algorithms (prefix detection, incremental filtering)

Difficulty

Level 3 – Advanced

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions