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
Just a thought:
What if we don't use structs with child/parent properties for fast access but instead use a dictionary of some sort (or any other hash table structure) to reach O(1) instead of recursively iterating over the children?
@wdg : Sooner or later you have to face it as a problem.
No one said we must not face the problem, but the thing is a lot of people already have searched for a solution, but sadly we didn't found a solution yet.
We should find a way to load this in the background, and return it to the main thread to update the UI.
if you open a file, the whole sidebar gets reloaded again (this should be prevented).
I think it's because of SwiftUI List's bad performance. It's based on NSTableView.
According to Instruments, the time-consuming operation is calculating the row item's height. While List has no functions like tableView(_:heightOfRow:).
I think it's because of SwiftUI List's bad performance. It's based on NSTableView.
According to Instruments, the time-consuming operation is calculating the row item's height. While List has no functions like tableView(_:heightOfRow:).
Activity
0xWDG commentedon Apr 4, 2022
Related to #20, #21, #25, #45 and #61.
This is a difficult issue.
lukepistrol commentedon Apr 4, 2022
Just a thought:
What if we don't use structs with child/parent properties for fast access but instead use a dictionary of some sort (or any other hash table structure) to reach
O(1)instead of recursively iterating over the children?Angelk90 commentedon Apr 4, 2022
@wdg : Sooner or later you have to face it as a problem.
0xWDG commentedon Apr 4, 2022
No one said we must not face the problem, but the thing is a lot of people already have searched for a solution, but sadly we didn't found a solution yet.
0xWDG commentedon Apr 5, 2022
We should find a way to load this in the background, and return it to the main thread to update the UI.
if you open a file, the whole sidebar gets reloaded again (this should be prevented).
CodeEdit/CodeEdit/NavigatorSidebar/ProjectNavigator/ProjectNavigatorItem.swift
Lines 69 to 93 in b565509
RayZhao1998 commentedon Apr 5, 2022
I think it's because of SwiftUI
List's bad performance. It's based onNSTableView.According to Instruments, the time-consuming operation is calculating the row item's height. While List has no functions like
tableView(_:heightOfRow:).lukepistrol commentedon Apr 5, 2022
@Angelk90 Can you share the project or a similar sized one you were using in your tests?
Angelk90 commentedon Apr 5, 2022
@RayZhao1998 : Do you have any possible solution in mind?
lukepistrol commentedon Apr 5, 2022
Found an article that mentions the same issue: https://kean.blog/post/not-list
Maybe we need to implement
NSTableViewourselves.Angelk90 commentedon Apr 5, 2022
@lukepistrol : Find the link above, in Additional context just download the project and install the node_modules.
lukepistrol commentedon Apr 6, 2022
Using
NSOutlineViewwrapped inNSViewControllerRepresentable. Still WIP but performance is great!Screen.Recording.2022-04-06.at.12.24.30.mov
lukepistrol commentedon Apr 6, 2022
Added a draft PR #411