From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Suhail Singh Newsgroups: gmane.emacs.bugs Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP Date: Sat, 07 Sep 2024 04:07:52 -0400 Message-ID: <87jzfnrinb.fsf@gmail.com> References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> <87h6asrk42.fsf@gmx.de> <86a5gk28ht.fsf@gnu.org> <87le0450x8.fsf@gmx.de> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9948"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: michael.albinus@gmx.de, Suhail Singh , 73046@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 07 10:10:11 2024 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 1smqWJ-0002Q8-AJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Sep 2024 10:10:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smqWC-0004GV-D5; Sat, 07 Sep 2024 04:10:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smqWA-0004Fq-Ry for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 04:10:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smqWA-00031m-Ek for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 04:10:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=fbSi/gv7VhauamWCjujVcaZhK8MPLWGvyWGsyBZ4myY=; b=t5pfUi7RA+6Q1KCQWJsO6EiW6is+G6QiF6jyTdtDv2aNf1PsKjquut12iQUaS4Gur2i7QTz4d9YKWig/iK5aR6Cc94lX58p0+7c0C/k7eaOLjD/xtePAZAU7cx5ZP4mnJHJARxkpcFxCKGW5+nJEWulKxdd73866qki4pQh9IaxFvvu4mDQUIrPhF1OcNtRZTHZW6ZYnXaBaZP4TQ4IMXsitohhclRaxNrXlwW1rolaplfxz4nnoyuWBN9wHwyfEkB6hFdPUx1UoGN2Ke1wL1D9sBU05CGCf3DKm4MRfOsK9fwDng4Ga5PZER4fh+xOXEsmkbcr8b0OxxBRkbcX1fA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smqWA-0003AV-Sb for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 04:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Suhail Singh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Sep 2024 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73046 X-GNU-PR-Package: emacs Original-Received: via spool by 73046-submit@debbugs.gnu.org id=B73046.172569655212098 (code B ref 73046); Sat, 07 Sep 2024 08:10:02 +0000 Original-Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 08:09:12 +0000 Original-Received: from localhost ([127.0.0.1]:54758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smqVM-000394-Bi for submit@debbugs.gnu.org; Sat, 07 Sep 2024 04:09:12 -0400 Original-Received: from mail-qv1-f68.google.com ([209.85.219.68]:48312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smqVK-00038q-RP for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 04:09:11 -0400 Original-Received: by mail-qv1-f68.google.com with SMTP id 6a1803df08f44-6bf7ad1ec3aso15299836d6.0 for <73046@debbugs.gnu.org>; Sat, 07 Sep 2024 01:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725696484; x=1726301284; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=fbSi/gv7VhauamWCjujVcaZhK8MPLWGvyWGsyBZ4myY=; b=nDKf2sXhXdD2fvOdaiJtXg+UuE4ZW3pCZM9SRAIbqgHVbsMwHoM3NPol5vLs0kOqDB eGcE+f5Awv5q4qPPUWQX1EKjwgp2OameErLZlISLi1DkDJS1xjHPlW1JXzIxln8ficUf dkQ3TbvpKuGu0+OjGX0MI83ZKA79xAmVVLxPi/rtrYRZpnairYDDxzgLG6YTt7FO496p KyMTcm0AwwuA5NEdBf5PJowW/vlp4wrhdGIvmanVkEttUbz/6fJIvCzJAd2eI9WFX1fZ iTGQ7San7DvEke1Zp6DNt+4bygmNG0Zvf5reqW3Apk/KrOV72abEdztr7ojrzj8HUnKu HVhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725696484; x=1726301284; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fbSi/gv7VhauamWCjujVcaZhK8MPLWGvyWGsyBZ4myY=; b=Zg0SQl3oChuJZ6Qpla2DyWnNPku7wu4vw7LX/8mYHCSrcRI+51CHuWSiYnAww841nK e958wmkuWJZmrwkRST6AQtC7JvnFBerAUNo02YwfLoyeof2RKZ3XriVDGc4luleT+tpJ qOCZPr0bMwVZmKAz9XZwq63JfiRwHjbf7PfyqaOcEYp/fEalcAxbh4oXV20W8b/SjBrC BoZwN9rlG6aSnloIYtCyHIZsX1g3Q03ROOu8kyjizCkuD19Qftxzx3eiRQBKXa3cv2BU 00vPD5jJZIlkkVhTkc+ek/XzgA7c5vGfuySZBOBBPrPlA30HGSYPvQ6YNcFCP/9/Dn1M I6VA== X-Forwarded-Encrypted: i=1; AJvYcCVxoq/1/O8OwniYf93pj995GFvF0ToCD93q7r69PW8ShEH5Lnh2OJEVf6e373IiHRcuzQFVTg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwwQPJ8lvILYCt/oTETS7rBPFTPCFBld4gdaU5DfFPkdcwlM+DR n1savOYaVA9ew9Jg9nMrbvH48XQrJNV72laFu9jLsyhjj0hxnrsztVTdAyrD X-Google-Smtp-Source: AGHT+IGLzQPCxECf7rW9yUU5R6QylSVXgovCXqmzGFA7qyRrEP6HxLozPBjj7dZV8hkUb74+jGH9Qg== X-Received: by 2002:a05:6214:3c8a:b0:6c5:1121:ab9d with SMTP id 6a1803df08f44-6c532495234mr23028146d6.49.1725696483960; Sat, 07 Sep 2024 01:08:03 -0700 (PDT) Original-Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c53474f8casm2840116d6.86.2024.09.07.01.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 01:08:03 -0700 (PDT) In-Reply-To: <86ttesyo1t.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 09:29:18 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291364 Archived-At: Eli Zaretskii writes: > Thanks you. So the problem seems to be symlinks, and specifically > symlinks to directories. After sending the penultimate email, and before sending the last (which contained the workaround for modifying `dired-font-lock-keywords' buffer-locally) I ran some more tests, and symbolic links to files are also problematic. Specifically, it's the three checks marked by the following comments in `dired-font-lock-keywords' that are problematic: - ";; Broken Symbolic link." - ";; Symbolic link to a directory." - ";; Symbolic link to a non-directory." Only when the three entries corresponding to the above are removed from `dired-font-lock-keywords', does the issue get resolved. Removing some (but not all) of the entries improves matters, but doesn't resolve them completely. Quoting Michael: #+begin_quote It seems to be related to font-locking, indeed. See variable `dired-font-lock-keywords'. It specifies face recognition running basic file oprtations. For example, ";; Broken Symbolic link" calls `file-truename' and `file-exists-p', while "Symbolic link to a directory" and ";; Symbolic link to a non-directory" invoke `file-truename' and `file-directory-p'. I believe it would be helpful to suppress these checks via a user option. And no, the checks shouldn't be suppressed for remote directories in general, on a fast connection they are valuable. #+end_quote > Michael, what does Tramp do specially in these cases that could > explain the slowdown? > >> The above observations seem consistent with Michael's comments above >> regd. font-lock checks for "Broken Symbolink link" and "Symbolic link to >> a directory". > > Michael, what do these checks entail, and why are they so > CPU-expensive and take a lot of time with slow connections? -- Suhail