You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening and closing folders with many files (2000 files for debug builds, 4000 to 8000 for release builds to reproduce) in the sidebar, it takes longer than expected.
Screen.Capture.2024-09-17.5.01.54.mp4
This is because NSOutlineView calls outlineView(_:child:ofItem:) (and related functions) for ALL elements.
When an element is expanded or collapsed, contrary to our intuition, NSOutlineView calls the delegate method for all elements, not just the visible ones, (presumably to maintain the element's expanded/collapsed state).
So delegate methods called at this time needs to complete as quickly as possible.
In this case I recommend using a very short term cache that is only valid while element expansion or collapse operation.
To Reproduce
Create a directory named test
Create many files in the directory. e.g. touch test{0001..2000}.dat
Open the parent directory of the test directory.
Expand/collapse test directory in the sidebar.
Expected behavior
The time taken to expand and collapse folders is not proportional to the amount of files.
CotEditor version
Version 5.0.0-rc (666)
macOS version
14.6.1 (23G93)
Additional context
No response
The text was updated successfully, but these errors were encountered:
Thank you for the feedback.
Well, that needs to be improved.
In this case I recommend using a very short term cache that is only valid while element expansion or collapse operation.
Thank you even for the recommendation. However, I feel it's a bit dangerous when the user expands multiple folders at once (with the Option+→ shortcut).
It, of course, depends on where and how we make the cache, though.
Looking ahead to future features like file filtering, I now feel it's better to have another tree (or children) only for the presentation.
Let me think.
Description
When opening and closing folders with many files (2000 files for debug builds, 4000 to 8000 for release builds to reproduce) in the sidebar, it takes longer than expected.
Screen.Capture.2024-09-17.5.01.54.mp4
This is because NSOutlineView calls
outlineView(_:child:ofItem:)
(and related functions) for ALL elements.When an element is expanded or collapsed, contrary to our intuition,
NSOutlineView
calls the delegate method for all elements, not just the visible ones, (presumably to maintain the element's expanded/collapsed state).So delegate methods called at this time needs to complete as quickly as possible.
In this case I recommend using a very short term cache that is only valid while element expansion or collapse operation.
To Reproduce
test
touch test{0001..2000}.dat
test
directory.test
directory in the sidebar.Expected behavior
The time taken to expand and collapse folders is not proportional to the amount of files.
CotEditor version
Version 5.0.0-rc (666)
macOS version
14.6.1 (23G93)
Additional context
No response
The text was updated successfully, but these errors were encountered: