Repository navigation
feat(neotree): virtualize unbounded file trees - #289
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Neo-tree silently loses files in large directories: the host stops enumerating after 160 filesystem entries, and the Husk presentation layer separately stops after 200 visible rows. Entries are discarded before sorting, so valid files can disappear entirely and existing timings understate the real cost of browsing a complete directory.
What changed
scripts/neotree_bench.py, a real-editor PTY benchmark that creates fixture directories, verifies the alphabetically final file is reachable, and measures opening latency, navigation latency, resident memory, and idle CPU.src/plugin/tree.rs, a compact virtual tree model that shares Husk directory-entry arrays and materializes icons, paths, Git decorations, branch guides, and theme styles only for visible or selected rows.docs/performance-neotree-unbounded-2026-08-21.md.Performance
Three-sample medians from optimized builds:
Baseline numbers above 128 files cover only the first 160 entries, not the complete directory. A separate 32,768-file stress run reached the final file in 119.88 ms with 0.694 ms p95 navigation.
How to Test
Build the optimized editor:
Run the complete-directory benchmark:
Expect every size to report
complete: true, no truncation marker, and the final alphabetically sorted file to remain reachable.Exercise the active-file reveal regression case:
Expect Neo-tree to reveal the already-open final file and keep that entry reachable in the large directory.
Run the focused directory, virtual-panel, Husk-core, and benchmark tests:
Validated locally with 2,958 passing Rust tests, six Neo-tree Husk tests, 19 Python tests, the bundled-plugin startup self-check, and all-target/all-feature Clippy with warnings denied.