GNU bug report logs - #41423
27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest]

Previous Next

Package: emacs;

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):

From: Gregory Heytings <ghe <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Tim Vaughan <timv <at> ughan.xyz>, 41423 <at> debbugs.gnu.org,
 "Gregory Heytings via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>,
 rrandresf <at> gmail.com, Michael Albinus <michael.albinus <at> gmx.de>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#41423: 27.0.91; eshell file completion in tramp dir is slow
 (3 minutes) [regression on pretest]
Date: Tue, 1 Sep 2020 13:50:16 +0200 (CEST)
>
> 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.