project panel: Improve performance in large projects (#13202)
In #12980 I've hoisted out creation of HashSet<PathInWorktree> out of render_entry, which made us not create that hash set for each entry in a worktree on each frame. In current nightly, we do it once per call to render() on the whole worktree, which is better. However, we can still reuse the hashed between the frames, if the worktree has not changed. Once we calculate the hashset for a given worktree state, we keep it around for as long as the state is valid for. We calculate the HashSet lazily, as we may not necessarily need it if the project panel is collapsed. In large worktrees, this helps keep the CPU usage of the main thread low-ish. Release Notes: - Improved performance of project panel in large worktrees.
P
Piotr Osiewicz committed
5dc54863a402a81aa9a3e864adc73964713933b6
Parent: e4ba336
Committed by GitHub <noreply@github.com>
on 6/18/2024, 1:09:52 PM