-
Notifications
You must be signed in to change notification settings - Fork 33
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
Extreme Slowdown when Using TRAMP #210
Comments
Thanks for the report, this is related to #205. I don't know what exactly is causing the misbehaviour maybe we have to look how ivy/icomplete handles tramp prompts. Any help investigating this further is greatly appreciated. |
This is weird to reproduce. It seems the problem only comes up when there is already an existing connection via tramp (in other words a |
I'm having this as well. I notice that there's no problem with the Regrettably I need to use the |
Same issue here as well. (To ease the situation for myself, while continuing to use
) |
#277 may improve things on this issue as well? |
I'm also have this issue. But in my case the connection to the remote machines have some serious latency and on top of that the disk I/O on those machines are terrible (slower than normal HDD). Only completion framework that works for me is emacs' default as that doesn't do completion until you hit tab. Which allows me to avoid running completion on certain directories that takes a long time to complete. To compare I tested to navigate to one of those slow directories using emacs' default,
This makes But I still want to use I'm testing this with commit f5f2329 from master. |
@plattfot Thanks for the detailed description. It is strange that the default is so much faster with default completion because we just use the default file table to compute candidates. I will have a look if there is some special tramp handling that we somehow miss. I remember I have seen some special tramp handling in counsel code as well which we should also look at to get more insight. Regarding you question you could use the following to fallback to default completion for files (the code is a bit convoluted to make it work best with recursive minibuffer sessions, too): (defun selectrum-read-file-name-default+ (&rest args)
(let* ((completion-in-region-function
(lambda (&rest args)
(apply (if (eq minibuffer-completing-file-name t)
#'completion--in-region
#'selectrum-completion-in-region) args)))
(completing-read-function (lambda (&rest args)
(setq-local minibuffer-completing-file-name
minibuffer-completing-file-name)
(setq completing-read-function #'selectrum-completing-read)
(apply #'completing-read-default args))))
(apply #'read-file-name-default args))) |
@clemera hmm yeah that sounds strange. I'll have some free time tomorrow so I'll see if I can profile the code and see what takes it so long. Thanks for the code! I made some slight modifications to just use the emacs' default file completion. And that works perfectly for me. (defun selectrum-read-file-name-default+ (&rest args)
(let* ((completion-in-region-function
(lambda (&rest args)
(apply #'completion--in-region args)))
(completing-read-function (lambda (&rest args)
(setq-local minibuffer-completing-file-name
minibuffer-completing-file-name)
(setq completing-read-function #'completing-read-default)
(apply #'completing-read-default args))))
(apply #'read-file-name-default args)))
(setf read-file-name-function 'selectrum-read-file-name-default+) |
That would be great! |
First runs of profiling and it seems the slow down might be due Also it seems there's some issue when trying to write out the profiler report when Repro: (require 'selectrum "/path/to/clone/selectrum/selectrum.el")
(selectrum-mode +1) Then enable First runs of profiling and it seems the slow down might be due Repro: (require 'selectrum "/path/to/clone/selectrum/selectrum.el")
(selectrum-mode +1) Then enable Also it seems there's some issue when trying to write out the profiler report. The report that is saved to disk is not the same as the initial report. I've pasted what I see instead of attaching the profile:
*Edit: Forgot to mention, use: (setf (caar profiler-report-cpu-line-format) 120) to change the width of the cpu line in the report. Otherwise you'll have trouble seeing the full stack. From emacs.stackexchange.com. I have modified the width before pasting it here so it would fit the post. |
And here is a run when using emacs' default
|
#335 Should also have improved the situation for this one? |
It seems to for me. (Also local navigation feels faster in directories with large numbers of contents.) |
much improved here as well. great work! |
Great news! Seems the file completion problems we had are gone then :) |
When using TRAMP to browse remote filesystems, selectrum slows down to the point of being unusable. The behaviour is observed both with and without prescient-mode. The remote machine is on my LAN so network latency is not an issue here.
Please see the following GIF which demonstrates the behaviour in both selectrum vs counsel-find-file (no, the GIF didn't stop-- it's that slow):

Also attached is a profiler log
The text was updated successfully, but these errors were encountered: