-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expanding directory super slow on large project #1096
Comments
Could be git-mode. How many lines of output do you get when you run I'll be able to clone kubernetes later today. Any particular directory where this happens or it there no pattern? |
Looks like if I disable git mode, it runs faster. Is git mode enabled by default? |
I am comparing the speed of treemacs verus dired or dired-sidebar. I think both dired and dired-sidebar are faster when expanding the same large folder. Is there any configuration I can disable more to speed up? |
28 lines when I run your command |
Another run of profiler. I think this is the root cause. Baseically if I already opened a lot of folders under a large folder, I close that large folder and re-expand... it can take few seconds to open.
|
I think this getting much worse with file-follow-mode on... I have 20+ file opened and the folder expanded everywhere. |
Yes. Specifically the version that waits 500ms for the async git process to finish before using its output for highlighting.
Then that's not the problem.
That's the issue then. Treemacs remembers what was open where, and re-opens all the previously expanded sub-sub-sub-directories when you do that. Depending on the amount of directories to open that can be a lot of work (mostly calling Emacs is single-threaded, what little async io capabilities it has I already use for git-mode. But it's not possible to do all the work in the background and finally just render the result up front, you have to block the UI. Add enough sub-directories and you start running into hard limits like that.
A few. Git-mode is probably not the problem because it is async already, but if you do notice slowdown because e.g. treemacs always needs to through 10000 ignored files you can look at You can set Turn To disable re-opening press TAB with a prefix argument. That way treemacs forget about opened sub-directories. If file-follow-mode is slow you can still manually find the current file in treemacs with Also when do the slowdowns happen - when you open things yourself, or because treemacs is doing something in the background on its own? |
Correction: even git-mode is a problem if you have enough sub-directories because treemacs needs to start a new process for every one of them. I tried things out on my own laptop (an pretty old Thinkpad), using kubernetes to render about 1000 lines distributed over 100+ sub-directories. Disabling git-mode and collapse-dirs features my time to render everything went from ~6s down to 200ms. Looks like plain file io is not the problem, it's the amount of processes I am starting. I'll see about fixing that, but in the meantime turning off these features should fix your speed issues. |
It slows down when I open things myself.
This is one of my faviorite feature haha |
Can confirm. Making Why does Also is this the right way to disable git-mode, |
This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues). |
It happens on a regular basis... I mainly program in Golang. For the project of size similar to Kubernetes, it gets very slow.
I tried to do profiler and here is my results:
Any idea?
The text was updated successfully, but these errors were encountered: