From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: 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) Message-ID: References: <87mu2d7hka.fsf@gmx.de> Reply-To: Gregory Heytings Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20941"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.22 (NEB 394 2020-01-19) Cc: timv@ughan.xyz, 41423@debbugs.gnu.org, rrandresf@gmail.com, michael.albinus@gmx.de, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 01 13:51:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kD4of-0005Lr-SH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 13:51:09 +0200 Original-Received: from localhost ([::1]:54846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD4oe-0001VE-Kk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 07:51:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD4oY-0001Uw-Jm for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 07:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD4oY-0002cB-Ad for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 07:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kD4oY-0005ET-6R for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 07:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Sep 2020 11:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41423 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Tim Vaughan , 41423@debbugs.gnu.org, "Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors" , rrandresf@gmail.com, Michael Albinus , Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.159896105020090 (code B ref -1); Tue, 01 Sep 2020 11:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Sep 2020 11:50:50 +0000 Original-Received: from localhost ([127.0.0.1]:55295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kD4oL-0005Dx-Qr for submit@debbugs.gnu.org; Tue, 01 Sep 2020 07:50:50 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kD4oI-0005Di-7p for submit@debbugs.gnu.org; Tue, 01 Sep 2020 07:50:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD4oH-0001JN-UO for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 07:50:45 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:65411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD4oF-0002V7-PY; Tue, 01 Sep 2020 07:50:45 -0400 Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 081BoKnu005863 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 1 Sep 2020 11:50:21 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 081BoSpC026843; Tue, 1 Sep 2020 11:50:28 GMT In-Reply-To: Received-SPF: pass client-ip=205.166.94.24; envelope-from=ghe@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/01 07:50:39 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186827 Archived-At: > > 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@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.