GNU bug report logs -
#41423
27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest]
Previous Next
Reported by: rrandresf <at> gmail.com
Date: Wed, 20 May 2020 16:23:02 UTC
Severity: normal
Tags: moreinfo
Merged with 47389
Found in versions 27.0.91, 27.1.91
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #77 received at submit <at> debbugs.gnu.org (full text, mbox):
>
> Would it help to profile the completion process in this use case using
> the built-in Lisp profiler?
>
No, because the bug is not about cpu or mem usage, but about doing
something useless that just takes time (without eating much resources).
A much better way to profile this is to use:
(defvar pcomplete-completions-at-point-time 0)
(defun around-pcomplete-completions-at-point (fun)
(message "calling pcomplete-completions-at-point")
(setq pcomplete-completions-at-point-time (float-time))
(let ((ret (funcall fun)))
(message "returning from pcomplete-completions-at-point, call took %.2f seconds" (- (float-time) pcomplete-completions-at-point-time))
ret))
(advice-add 'pcomplete-completions-at-point :around #'around-pcomplete-completions-at-point)
(let ((default-directory "/ssh:user <at> host:~/")) (eshell))
This will print:
calling pcomplete-completions-at-point
returning from pcomplete-completions-at-point, call took 0.00 seconds
calling pcomplete-completions-at-point
returning from pcomplete-completions-at-point, call took 0.00 seconds
calling pcomplete-completions-at-point
returning from pcomplete-completions-at-point, call took N seconds
The value of N depends on the speed of your connection. On a fast
connection it will be something around 50, on a slower one something
around 100. With a local directory (that is, without let-binding
default-directory before entering eshell) it depends on your machine. On
a fast one it will be something around 0.10, on a slower one something
around 0.50.
Note again that this third call to pcomplete-completions-at-point does
nothing useful. It just build a list of all possible commands, and throws
it away.
This bug report was last modified 3 years and 25 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.