Skip to content

perf: files-screen visibleEntries memo recomputes on every keystroke, no debounce #39

@Interstellar-code

Description

@Interstellar-code

File: src/screens/files/files-screen.tsx:1517-1542

visibleEntries is a useMemo over the full file tree, keyed on treeQuery (raw search input). It re-walks the tree on every keystroke.

Suggested fix: debounce treeQuery (150-200ms) before feeding it to the memo.

Related: entryCounts (line 1543) also walks the tree recursively on every entries change — consider caching on entries reference equality.

Severity: medium — feels janky on bigger trees.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions