From unknown Tue Jun 17 20:31:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#73046 <73046@debbugs.gnu.org> To: bug#73046 <73046@debbugs.gnu.org> Subject: Status: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP Reply-To: bug#73046 <73046@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:31:58 +0000 retitle 73046 29.4; Emacs 100% CPU usage for several seconds when opening d= ired buffer over TRAMP reassign 73046 emacs submitter 73046 "Suhail Singh" severity 73046 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 10:55:10 2024 Received: (at submit) by debbugs.gnu.org; 5 Sep 2024 14:55:10 +0000 Received: from localhost ([127.0.0.1]:37823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smDt7-0007sE-Hn for submit@debbugs.gnu.org; Thu, 05 Sep 2024 10:55:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:51022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smDRL-0005mv-Du for submit@debbugs.gnu.org; Thu, 05 Sep 2024 10:26:28 -0400 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 1smDQG-0000wA-40 for bug-gnu-emacs@gnu.org; Thu, 05 Sep 2024 10:25:21 -0400 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smDQD-00020D-C4 for bug-gnu-emacs@gnu.org; Thu, 05 Sep 2024 10:25:19 -0400 Received: by mail-qv1-xf42.google.com with SMTP id 6a1803df08f44-6c34c02ff1cso5164666d6.2 for ; Thu, 05 Sep 2024 07:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725546315; x=1726151115; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=QRH1uESyYGutXmCSR9rIpWUIBsbbvYxhaweWeJCOhhE=; b=dmuh0oiCZLjWggKGqs/lSlFLGdlncK9nbL6F2tbjszeaUB11bTBztrHq0TcttDtnSt qxhXpLaj8I2SUlVlfqrW633asDOW96SrXBw/xbJy1j8v70noVM8SqVlWC/6h05H7Rxkv kf3TnWljpsywj2O2jayKUDJFWKqWslQ3KnxhaHhRwbOJRC+7Nid45FJXW+b8/sLgFLCe a1uMpIKMAheIo1Q2rSru8Kd9OyO0HDTTeTvyQxGRwrMsJnM9D7ILB+a3psVbYUxOI1Ms GdK1jz2TxnZQd+aEG5MYLBONfDmFcB0lbwtCCFu6c1hmmkFJYf+6Px0PWwiEVEx9GKts Is4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725546315; x=1726151115; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QRH1uESyYGutXmCSR9rIpWUIBsbbvYxhaweWeJCOhhE=; b=LJ/k16BRa7R8OK7c9F9Wem5pKSIk0ngb8ZHmti8fZS3FmqbP3kWGOGS8g6u4r1DYnI 6DAzfkM74KR915fPVWhMmoSO21ccsSHvcz1WiA4M1hrdWzhoW/BER2tV/e+fDxnBZsWB dwDn40BsNKCG3xcy+CVBP+oGpWSFl67+e3efFFwpc1raY+gLV9HWZNHkPuzJORAENGdz R7xEAqC9iHyh+QIe/wL/5Qlasi4Lf9xb/JjQn857QENZOIENpPfQCT++iToqf5MXQaSJ 6qPbG18shVgep7ebU2WnHTjQflaxR4A5QBgT3q8tDRTX2IamrD1Y3Lhq9di3kdrQDwER rksw== X-Gm-Message-State: AOJu0YzLkkMho6tx94jLApbOXnHOUVBDI6jOkdk4mdxPZfMM/NXAxKK6 QoV1mp6OWkcLlJX2dXo2aKPTckS73qiqy+l5ZrXZEYgHkph9wfxRGCnm2Hz2 X-Google-Smtp-Source: AGHT+IHyuiG8ytUrAE09B+Kg0HVkIPDLQTynG5da20J3lPC57RCx9IC56n3Lj8gWXSMXbEU8IYYgrQ== X-Received: by 2002:a05:6214:4988:b0:6c3:67d5:aa1 with SMTP id 6a1803df08f44-6c367d50e15mr157959676d6.10.1725546314634; Thu, 05 Sep 2024 07:25:14 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5201e415fsm7910826d6.33.2024.09.05.07.25.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:25:13 -0700 (PDT) From: "Suhail Singh" To: bug-gnu-emacs@gnu.org Subject: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP Date: Thu, 05 Sep 2024 10:24:54 -0400 Message-ID: <87o75241qh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f42; envelope-from=suhailsingh247@gmail.com; helo=mail-qv1-xf42.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) I observe 100% CPU usage for several seconds when invoking dired for a directory on one of the remote machines I connect to. This doesn't seem to happen for another host. The connection to the affected host is slower, and on that host the issue is worse when the directory has several symlinks. To reproduce via =emacs -Q=: - Invoke `find-file' and connect to problematic host over ssh. - Once connection is established, open dired pointing to a directory on the affected host. - Observe bug: it takes _several_ seconds for the dired buffer to show. During that time, Emacs CPU usage is 100%. - Once dired buffer is open, invoke `revert-buffer' and observe issue again. Disabling global-font-lock-mode, makes the situation better. Given that rudimentary font-locking should be possible via, simply, the output of `ls --dired', it is unclear why enabling font-locking makes things so much worse. If there are some aspects of font-locking that perform much worse over a slower connection, it would help if there were a user configuration to disable them. It would also help if being over a slow connection didn't result in Emacs consuming 100% of the CPU via functions such as `tramp-wait-for-regexp' (based on profiler-report). Could some of this be done asynchronously? In GNU Emacs 29.4 (build 2, x86_64-suse-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.0) System Description: openSUSE Tumbleweed Configured using: 'configure --disable-build-details --without-pop --with-mailutils --with-native-compilation --without-hesiod --with-gameuser=:games --with-kerberos --with-kerberos5 --with-file-notification=inotify --with-modules --enable-autodepend --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --localstatedir=/var --sharedstatedir=/var/lib --libexecdir=/usr/libexec --with-file-notification=yes --libdir=/usr/lib64 --enable-locallisppath=/usr/share/emacs/29.4/site-lisp:/usr/share/emacs/site-lisp --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-dbus --with-webp --with-xft --with-imagemagick --without-gpm --with-x-toolkit=gtk3 --with-pgtk --with-toolkit-scroll-bars --x-includes=/usr/include --x-libraries=/usr/lib64 --with-libotf --with-m17n-flt --with-cairo --with-xwidgets --build=x86_64-suse-linux --with-dumping=pdumper 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -D_GNU_SOURCE -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label -fno-optimize-sibling-calls -DPDMP_BASE='\''"emacs-wayland"'\''' LDFLAGS=-Wl,-O2' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB Important settings: value of $LC_NUMERIC: POSIX value of $LC_TIME: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired-aux dired dired-loaddefs tramp-sh tramp-cache time-stamp tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat rx shell pcomplete comint ansi-osc ring parse-time iso8601 time-date format-spec auth-source cl-seq eieio eieio-core cl-macs cl-loaddefs cl-lib password-cache json subr-x map byte-opt gv bytecomp byte-compile ansi-color rmc delsel lpr easy-mmode pcase iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads xwidget-internal dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 94415 10209) (symbols 48 8472 0) (strings 32 27423 1593) (string-bytes 1 934096) (vectors 16 17482) (vector-slots 8 388602 12097) (floats 8 33 35) (intervals 56 549 0) (buffers 984 12)) -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 12:10:11 2024 Received: (at 73046) by debbugs.gnu.org; 5 Sep 2024 16:10:11 +0000 Received: from localhost ([127.0.0.1]:37985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smF3i-00058t-Q4 for submit@debbugs.gnu.org; Thu, 05 Sep 2024 12:10:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smErj-0004Af-Od for 73046@debbugs.gnu.org; Thu, 05 Sep 2024 11:57:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smEqb-0003Uc-5n; Thu, 05 Sep 2024 11:56:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=x8GnycZvoN6YqHVM9ZPKZ+x2agGew1dH1gDxttJprMY=; b=dTkvhz669ixE fgrd4AldZzqNTiOr6Dgm16PEyVWvEq/eUzawl25VrSNRhddc8GLd2gCyuIdTQE16IkXgjF4tufRWt T+JdLdb/g2RS85Md0tpgmollKxK4fiN2Wqvm6wKAHIDfCwDXQ5H+FYZ3eR+/7K6NRpK5X8HtWpak+ 0ETeXqDVwMQL5Vk8ulT0y9+oNTeF8sqw1gJdFFEzjMGerPVLGSRc/MA5KluhTm1oLDNpk9ArS0Ccf eoWojPGRhzWQMojjs8y2w8PI5zhp5KwuSReZ/r6JTzcjuSzpy4RRM50mldorvBxBnrnUKNEQDI9kF /f54sAnV2kKw9EWdNnw2xw==; Date: Thu, 05 Sep 2024 18:56:33 +0300 Message-Id: <86plpi2ixa.fsf@gnu.org> From: Eli Zaretskii To: "Suhail Singh" In-Reply-To: <87o75241qh.fsf@gmail.com> (suhailsingh247@gmail.com) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP References: <87o75241qh.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: "Suhail Singh" > Date: Thu, 05 Sep 2024 10:24:54 -0400 > > > I observe 100% CPU usage for several seconds when invoking dired for a > directory on one of the remote machines I connect to. This doesn't seem > to happen for another host. The connection to the affected host is > slower, and on that host the issue is worse when the directory has > several symlinks. > > To reproduce via =emacs -Q=: > - Invoke `find-file' and connect to problematic host over ssh. > - Once connection is established, open dired pointing to a directory on > the affected host. > - Observe bug: it takes _several_ seconds for the dired buffer to show. > During that time, Emacs CPU usage is 100%. > - Once dired buffer is open, invoke `revert-buffer' and observe issue > again. > > Disabling global-font-lock-mode, makes the situation better. > > Given that rudimentary font-locking should be possible via, simply, the > output of `ls --dired', it is unclear why enabling font-locking makes > things so much worse. If there are some aspects of font-locking that > perform much worse over a slower connection, it would help if there were > a user configuration to disable them. > > It would also help if being over a slow connection didn't result in > Emacs consuming 100% of the CPU via functions such as > `tramp-wait-for-regexp' (based on profiler-report). Could some of this > be done asynchronously? You could probably tell which parts take the time by profiling Emacs while it collects the Dired data, using profiler.el. This could give clues about the expensive parts. My guess would be that retrieving the attributes of the files Dired needs are the reason, but I could be wrong. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 05 17:06:49 2024 Received: (at 73046) by debbugs.gnu.org; 5 Sep 2024 21:06:49 +0000 Received: from localhost ([127.0.0.1]:38375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smJgm-00028J-Ow for submit@debbugs.gnu.org; Thu, 05 Sep 2024 17:06:49 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:42242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smJgk-000284-TK for 73046@debbugs.gnu.org; Thu, 05 Sep 2024 17:06:47 -0400 Received: by mail-qk1-f196.google.com with SMTP id af79cd13be357-7a7fef9a5fdso133693685a.1 for <73046@debbugs.gnu.org>; Thu, 05 Sep 2024 14:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725570275; x=1726175075; 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=RpK4Q3RhqzEEYGfyIp40oNd1lokdY8sa7teyRXzbNGE=; b=lwvP87DNjxF2ns+3Ev4FJFdIpM6eGUI2YAia5RB4aK2XpaiFlk/fJCWzSWeYl2GHUl 9Xrsu9fHjm5NA3Vlg6i6tR51VEtB4qb1fsZ1dKwk+O+OU+4AM8oyhzmtEw1zGkt8/oud l1TKSRmrihUK2nW1vIciBF39e+dcnl54+dlDRe9YYzKdWvjiWCjsZ0tWzi5Gq1Cnz4pq D72CW4yYtl2y6YZ/KNRGqW2+u6HClJ8k+69tTukZR51nhSNisxh28DzD12EFZpjQxWnw LZD7zEwahGstXc8vf6a5Fz8xCL9CnT1RvWoQeV3J1DevUzhj3gGv34b9uGD1Wga5XAKk LRjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725570275; x=1726175075; 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=RpK4Q3RhqzEEYGfyIp40oNd1lokdY8sa7teyRXzbNGE=; b=CJKZfEShwt7F0shfL7kA4T7/PcKr0XIScUImaPWjTHEs6qdbcWYM4DmGHlRcJfIP9k RoM1kbnQtjEkdaHhB3D5TVQHlnL7Xdb3Jv9fBhp1gVZiMcRv05//siorBPTSc2hivfGR dZAV6urQG+cVH5TMvzy/iUUoHFusW3LnPyje2FQI496iHMz5CnOAQj6aSmZgWhRQlKIn 5Gs1/RPhcgWlSpS9tfikeX2T+SIp5xOaZZ1hzKMcvRlE6F/aBaDXobwe7DT+uhWt7ZMb wmHSCqVOz1nHuQ0dhc/g/2qVQJXkzQUuP3QIS2ZEl4IJtC3+M5fchHgBxQ185RbUGwxS Z45g== X-Forwarded-Encrypted: i=1; AJvYcCXMgapbFzIfF8HZ78jv5Jm2kBpH1vX75dme/rpG2VeUzHYtq36ge4ILwfQ88cXzviWf5yU11w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzFEvrwWmi7Zr9pcB+PaGlKREuA+PStXftqVhmCOWp/x9E2koPn LHOdOxohKx2N9mytKteahwncZeQcVTA6V+YEI50i7Xl/NgaIv11stPKOiun4 X-Google-Smtp-Source: AGHT+IHqlsfEQFrjltvNdieLtiLD1iyF1IeIhRgbz5CR9bsTLOTECTfAP3fnMIJrvgxuEfxpThtNxg== X-Received: by 2002:a05:620a:2411:b0:7a8:21c:e76c with SMTP id af79cd13be357-7a996e2bb5bmr122155985a.33.1725570275122; Thu, 05 Sep 2024 14:04:35 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a98f00ad38sm108355985a.112.2024.09.05.14.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 14:04:34 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86plpi2ixa.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Sep 2024 18:56:33 +0300") References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> Date: Thu, 05 Sep 2024 17:04:23 -0400 Message-ID: <87seudke20.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: >> From: "Suhail Singh" >> Date: Thu, 05 Sep 2024 10:24:54 -0400 >> >> >> I observe 100% CPU usage for several seconds when invoking dired for a >> directory on one of the remote machines I connect to. This doesn't seem >> to happen for another host. The connection to the affected host is >> slower, and on that host the issue is worse when the directory has >> several symlinks. >> >> To reproduce via =emacs -Q=: >> - Invoke `find-file' and connect to problematic host over ssh. >> - Once connection is established, open dired pointing to a directory on >> the affected host. >> - Observe bug: it takes _several_ seconds for the dired buffer to show. >> During that time, Emacs CPU usage is 100%. >> - Once dired buffer is open, invoke `revert-buffer' and observe issue >> again. >> >> Disabling global-font-lock-mode, makes the situation better. >> >> Given that rudimentary font-locking should be possible via, simply, the >> output of `ls --dired', it is unclear why enabling font-locking makes >> things so much worse. If there are some aspects of font-locking that >> perform much worse over a slower connection, it would help if there were >> a user configuration to disable them. >> >> It would also help if being over a slow connection didn't result in >> Emacs consuming 100% of the CPU via functions such as >> `tramp-wait-for-regexp' (based on profiler-report). Could some of this >> be done asynchronously? > > You could probably tell which parts take the time by profiling Emacs > while it collects the Dired data, using profiler.el. This could give > clues about the expensive parts. My guess would be that retrieving > the attributes of the files Dired needs are the reason, but I could be > wrong. Based on =profiler-report=, the following function "chains" consume most of the CPU: - `font-lock-fontify-keywords-region' - tramp-sh-file-name-handler - tramp-sh-handle-file-truename - `tramp-wait-for-regexp' - tramp-sh-handle-file-exists-p - `tramp-wait-for-regexp' - tramp-sh-handle-file-directory-p - `tramp-wait-for-regexp' - tramp-sh-handle-file-attributes - `tramp-wait-for-regexp' As noted previously, disabling global-font-lock-mode helps. In related news, one thing I've observed on the affected host is that the version of `ls' doesn't seem to yield expected output for `ls --dired'. Specifically, the output of `ls --dired' is the same as the output of `ls' (i.e., `--dired' gets treated as a no-op). The version of `ls' on this host is: #+begin_quote ls (GNU coreutils) 8.32 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Richard M. Stallman and David MacKenzie. #+end_quote -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 01:44:15 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 05:44:16 +0000 Received: from localhost ([127.0.0.1]:38980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smRlX-0000QZ-HU for submit@debbugs.gnu.org; Fri, 06 Sep 2024 01:44:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smRlV-0000QG-01 for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 01:44:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smRiC-0002zh-1u; Fri, 06 Sep 2024 01:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ujYzpKIKVtX+M52pD/a54+YnaZyK3VpS76t2kaAztUI=; b=BG0kZ/GtSBRB 4oxHVfYW8nBEVwkqHWaHdLniL8L9BQYPTJ7HZ6o+BmRlCPXIU+ORJk3kMWRli51k0f7pZqtqcj3/e iZdGM+nch8EexoXU0os4iZpsSNWWDc2Sw+lf03nGuNe+COQrWA01FdbWFHkMRlT81b6+rk54f4yt/ SY2QJQeeCxGYgrXtdDd4nGzxyazfQg6bdQGIHLpQ7/Nji4PfZof7MjYND5M9OC2pO9UzNIFNxvqQ5 lk7dLMwK+0FDZSgdjRLOvbOQYvFfHpF06dCqN9DtPT6HyNNDZ/z+CHO1g6WYm8ur6/e9iY7pa63ze 9MkHxx1CbS2GdpKacAlA/g==; Date: Fri, 06 Sep 2024 08:40:45 +0300 Message-Id: <8634md2vc2.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <87seudke20.fsf@gmail.com> (message from Suhail Singh on Thu, 05 Sep 2024 17:04:23 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: "Suhail Singh" , 73046@debbugs.gnu.org > Date: Thu, 05 Sep 2024 17:04:23 -0400 > > Eli Zaretskii writes: > > >> It would also help if being over a slow connection didn't result in > >> Emacs consuming 100% of the CPU via functions such as > >> `tramp-wait-for-regexp' (based on profiler-report). Could some of this > >> be done asynchronously? > > > > You could probably tell which parts take the time by profiling Emacs > > while it collects the Dired data, using profiler.el. This could give > > clues about the expensive parts. My guess would be that retrieving > > the attributes of the files Dired needs are the reason, but I could be > > wrong. > > Based on =profiler-report=, the following function "chains" consume most of the > CPU: > - `font-lock-fontify-keywords-region' > - tramp-sh-file-name-handler > - tramp-sh-handle-file-truename > - `tramp-wait-for-regexp' > - tramp-sh-handle-file-exists-p > - `tramp-wait-for-regexp' > - tramp-sh-handle-file-directory-p > - `tramp-wait-for-regexp' > - tramp-sh-handle-file-attributes > - `tramp-wait-for-regexp' > > As noted previously, disabling global-font-lock-mode helps. FWIW, I cannot reproduce this: I tried Dired on a remote host with which I have connection that is quite slow, and saw neither high CPU usage nor a significant delay in displaying a Dired buffer. > In related news, one thing I've observed on the affected host is that > the version of `ls' doesn't seem to yield expected output for > `ls --dired'. Specifically, the output of `ls --dired' is the same as > the output of `ls' (i.e., `--dired' gets treated as a no-op). This could indeed explain the problem. However, ... > The version of `ls' on this host is: > > #+begin_quote > ls (GNU coreutils) 8.32 > Copyright (C) 2020 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later . > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. > > Written by Richard M. Stallman and David MacKenzie. > #+end_quote This cannot be true: the --dired option was added to 'ls' way earlier. I have Coreutils 6.9 from 2007 on one of my systems, and --dired is supported there. To see if it is supported, try this: $ ls -al --dired You should see 2 extra lines of output after the listing, each one starting with "//DIRED". From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 09:29:24 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 13:29:24 +0000 Received: from localhost ([127.0.0.1]:52483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZ1g-0007RM-6k for submit@debbugs.gnu.org; Fri, 06 Sep 2024 09:29:24 -0400 Received: from mout.gmx.net ([212.227.17.22]:47661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZ1d-0007Ql-Ls for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 09:29:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725629355; x=1726234155; i=michael.albinus@gmx.de; bh=OSwqCON6B/ACY2B6EF1AP8TxSZPSVGQc3JsyfDrU8Qc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=dTLjZwyeDuvXV0Q972EslnD6R0ca2boi7dMMy9JDZIz2tGi5ox11hukEq6kVrOov trMP+YP8g/QQS8P4wbq9DlzZI5hyg4cJn5CgfwRwL52VlLr13FQ+WaSTrFxrNZTa8 +3nLeqyyMQk8FIYan65j5UGVJpHnrnx5hyoP+kDDDgwfyGiHDmdDjpp7vgSnRURgV I9+WyS4+KiyGuU9y2658WZhmYWNvKtRwG8mBg68nruCj2DrZ3v+6eajB7mb+uhca8 BBkjecMrKjibKLm/hvqV6lcOhqcCyz0whq5BpsZmO3vUn1qIkv83HnGkpQGQHMgs4 rp/Zr3sOnQU5sB0R4w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5VD8-1rxgEb0pXm-016wzp; Fri, 06 Sep 2024 15:24:03 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <8634md2vc2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Sep 2024 08:40:45 +0300") References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> Date: Fri, 06 Sep 2024 15:23:57 +0200 Message-ID: <87h6asrk42.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:ZNYOFBr1+lg8l+WmQh/HU8ghpEQxelI300npN6I5HFQe/yUGkDe 4EAIC50hiEmocvwChNn9dTnArAjC6FMl8/msEJ8lNhGfBRIbdsN8XJJJcjWXcWP9zMUR87/ HCZ5raXkWJqnPOjCf2erQh9slbOMKnaAoh0Ok+bYzsdf6XymFoBSCRybcQ8FqVWUyFGGtj+ 8ff9cngn0M803O9khxcqg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:qscQXmykOaQ=;QOsq+wy+dhfh/y3UKaz/kyVztLJ rPGX3CphgXyoBbxy9i6A1gu+CVYFmZ6Tyk6qUPDmhCud9zKhb+E8Or/v0HVl0VOPDWuOV5YNN HVzB/7JeDLhh1pgs+TJusf0IcRr0ycYhu1k0KWbuUcQ8FYiBoC53cjfbWkL5rkV5Bu1LdOzO5 IadSXDE3s3CX1aHP71MBWpKBXMfmg0j43xknnUVQw6IuNzaV7yLXOTW6oSEAhtV1si5dFEolg EsJSpHqJE26tF+Ahpr71LK/nM8BjAEr6hnEm2BHM6hkqxs2+0VTYre4SYxSr0HAxt8enEM1mV KorMG2YGS/nw+V4yeTEWmrKueJT8Lkkkf9hUb7f/S5Zsyuxzz1synlCp6JnRRi1gyh4VgmK22 lyPNygIqBqTIswCKgPF50mU3lPFLEKT9aaugqTOSE6oQ6fLOZo0UU8AANX70qufgfmrPCbYYF SrgEShvRo2mLM1ch6sND5TxaTSr6UScyqfXfdQLAvAHpfVZYoRAAdBL2/Lm9foP/GXxFmSL4z u3qLxzgURP89Mkruj+9xru11C/ED3+ze4X0F+m8JNZayK1PORjyIMkWfcbwcdQ19hNvL50Z8f tEDp2hks9HgDbm2xw9CQ1AWdChIYIOXUXbc+3/pMB8VEDUj2rDGsUP90MjDof3d0roXZ4HFMx LEFGhqPewesSUYPz5/J5CydQ6HVu6qhJhgTwLkccNF+I4QEdT0SqVFV3uESvhFyjwwAkH4G71 ClNUwqAUfxiz5oXRlzdrhnDXGj4OgiGlt77u0SBgJp/L/uDnPzg+/qSeYXKTvh6jCHshTlIoL 16uaoptYtnD+R7QHKzOq+VuA== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi, >> >> It would also help if being over a slow connection didn't result in >> >> Emacs consuming 100% of the CPU via functions such as >> >> `tramp-wait-for-regexp' (based on profiler-report). Could some of t= his >> >> be done asynchronously? >> > >> > You could probably tell which parts take the time by profiling Emacs >> > while it collects the Dired data, using profiler.el. This could give >> > clues about the expensive parts. My guess would be that retrieving >> > the attributes of the files Dired needs are the reason, but I could b= e >> > wrong. >> >> Based on =3Dprofiler-report=3D, the following function "chains" consume= most of the >> CPU: >> - `font-lock-fontify-keywords-region' >> - tramp-sh-file-name-handler >> - tramp-sh-handle-file-truename >> - `tramp-wait-for-regexp' >> - tramp-sh-handle-file-exists-p >> - `tramp-wait-for-regexp' >> - tramp-sh-handle-file-directory-p >> - `tramp-wait-for-regexp' >> - tramp-sh-handle-file-attributes >> - `tramp-wait-for-regexp' >> >> As noted previously, disabling global-font-lock-mode helps. > > FWIW, I cannot reproduce this: I tried Dired on a remote host with > which I have connection that is quite slow, and saw neither high CPU > usage nor a significant delay in displaying a Dired buffer. 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. In bug#17064, the impact of these calls where discussed. The conclusion wa= s =2D-8<---------------cut here---------------start------------->8--- > Or could this have any bad side effects? Is it maybe too heavy to call > `file-truename'? Normally, there aren't many symlinks in a buffer, so I think the performance impact would be negligible. =2D-8<---------------cut here---------------end--------------->8--- Likely, this was too optimistic ... Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 09:54:42 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 13:54:42 +0000 Received: from localhost ([127.0.0.1]:52510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZQA-0000Rd-0S for submit@debbugs.gnu.org; Fri, 06 Sep 2024 09:54:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZQ7-0000RP-Cy for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 09:54:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smZQ1-0002wY-Om; Fri, 06 Sep 2024 09:54:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=apYzO61O09P+hpCY0k5toq6qe39kIo7gBPh6EYmzjO8=; b=e4Pqo/ogoEhz AdBdOaWxduZjtJ262Tl5W2FNzREjn+G7peNuRH0lMuQW4Hna+2HDlVPzHaRokhigj+2jZgXbWyos3 fPdxPwTnsoGaY7A5MTYiHT86DN4845n/bcLk9WvOL//EnY7CzLafC28lyoKL/K1CRgAm/xrg3s019 1XxRfHG+RGNpLr1t1L3kPozwd8iHnWiB1O0KARLZe8Xj3z11CVbq9V1X2kln8zdU3UIKlmK/6cR9v swRGOtC1U5d1oj5/F7V8yOeBEYMNsO+NfSiNmMFdeNkd/L7uXlX1bM6fK8z/uYDZXVo7Vpb0eG889 nzSyAHm6aJ/BuvqGXSUGrQ==; Date: Fri, 06 Sep 2024 16:54:06 +0300 Message-Id: <86a5gk28ht.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87h6asrk42.fsf@gmx.de> (message from Michael Albinus on Fri, 06 Sep 2024 15:23:57 +0200) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> <87h6asrk42.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Suhail Singh , 73046@debbugs.gnu.org > Date: Fri, 06 Sep 2024 15:23:57 +0200 > > > FWIW, I cannot reproduce this: I tried Dired on a remote host with > > which I have connection that is quite slow, and saw neither high CPU > > usage nor a significant delay in displaying a Dired buffer. > > 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'. But font-lock is ON by default, so what I saw also includes this, right? > I believe it would be helpful to suppress these checks via a user > option. What's wrong with "M-x font-lock-mode RET"? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 10:09:43 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 14:09:43 +0000 Received: from localhost ([127.0.0.1]:53705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZeh-0001aJ-Eo for submit@debbugs.gnu.org; Fri, 06 Sep 2024 10:09:43 -0400 Received: from mout.gmx.net ([212.227.15.15]:59071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smZec-0001ZR-Ue for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 10:09:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725631766; x=1726236566; i=michael.albinus@gmx.de; bh=oddASl3fIeYkqfrPucPTZIEUnU+IWWT3gF3ltMABIkA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=UI8CUNlsmdHvVlNPeJAsnYW6+RPR7Ah7I2dLhfXHZvitOS2rZMkQr1Sy9aC+znba qyCxnKqyLzyFHzwIyrTAeY4YwMzc42eu3H2hTQeLSfaxrnrsLspBhSGqs9L06fQg6 +OI2H+LnxKufiY8wVykRFny9tZiiDb0vjxt7mExqjibZ9z6H1f9jDgYvP1hXELyS+ DCmoh8lFotMnY+GsR+fJzWLzQ2XNiUTePGsKp9WtnvNMk+XbFXzouvICwTsOUXmus m7Rs9tXeYEzgUDUY5zU/geeg9a4/x4yep7ZXuSW6xI7+ovtFb9IsHPuCZlOFOfLyl miBS/9e5yC1Dq6feuQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mf0BM-1s6NLA2bwA-00nSUc; Fri, 06 Sep 2024 16:09:26 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86a5gk28ht.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Sep 2024 16:54:06 +0300") 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> Date: Fri, 06 Sep 2024 16:09:23 +0200 Message-ID: <87le0450x8.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:BHKp11Wb5G0NkhXWA57pbO6HEx/fsgZPnJR76LeijE/zWwCRmGy +jfcn51fBy//9jSYKjohH0OB7EZbyhH5fBkh3zST7neRf+qIjdJ0W7YM+2nlD8Icpopqv8b j2CfAIEGz+ACDzQo8K6z+8TV60rPV+gG73qizjGysuUpDkyaJYWbdst599VLBc28evzSTmk UYgSJYT0VjwHzm/QO3JzQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:0xdbOSFE6wQ=;J0q1Rr6+ZOLzAztGST8IXHOjE8s yqutK8ckYXT5+tMFw/LT6kG24v3B3fbOqhN7QCJacaC70u/rbuf5sgzEKuBNGU+y0ych+b2h1 +MWXJrJs3H77XGkoaV7NZuy4LWG+t+OmW0qNnct4n8xjHNLwyPanbPPb0hzDZM0xF8SeUMy0c c21bHuTjjOUNAm/QBi9TgeTPjPrbX7oNMXw1wr/sfgiVLmdZ/PUZzx5zeKYC6vagTDnehq4ad QUWbPOZsbhHxZkUUW56t5JpH0FVyGNfKkH0Rr9tGxvUApW4OZ+LXKU+bJFZKSmlHyx9EufxqW 3tpOdPAwbxUZ9zZyVSlmgAM5SBQ+KXHkmEOmdsjeTVNQinFVczsJgXftfO+gi00qKzrIEFaHh D6t9JrxY+gGbUHHZXa2hIey6ZayJ2BA/IXYUlVMvFnX5PDEb7LovfAqEi/v+MqThip16nt9Y1 vPApNbrUXnXWch13jtDpYTmyaQc7l1uVrXPEXUHt99JQkoGL7pS7QpO8uGcMqW3FS8p79O9vw 6aAlENO5aOdlridV8GRJB+FPUq6EVBoMVgqwraiU++TlnnACPG9qItu+l1lc2KnT3A4GxCZtz 8fPFFuU8j2Kgz6FHOlML9pIUDCY4AXfGm1dncFZYWnx4g4y0KVX+3T6UQKOodMtQ2S8tDi/9I pSKfeVNSupKsZrBn1P1uWgv8OpLfZqO/1Lf7pC3+6MDRmfbQ0ft8GQpD26QJYmzFWrSWvT+lX btGdaC6ibPEOfbDcbOqzlI4nmfYmgGr9ybt7/VPW7wri2yJzilrYV5yELFos0anYp625Sasxf vNXq2uXt65noEZ0a9S864GwA== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, >> > FWIW, I cannot reproduce this: I tried Dired on a remote host with >> > which I have connection that is quite slow, and saw neither high CPU >> > usage nor a significant delay in displaying a Dired buffer. >> >> 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 director= y" >> and ";; Symbolic link to a non-directory" invoke `file-truename' and >> `file-directory-p'. > > But font-lock is ON by default, so what I saw also includes this, > right? Sure. But we don't know the exact setting of the OP. The connection could be extremely slow for him, Tramp's cache might be disabled, whatever. Perhaps it's worth to rerun the test with "emacs -Q". >> I believe it would be helpful to suppress these checks via a user >> option. > > What's wrong with "M-x font-lock-mode RET"? You would deactivate all fontifications, not only the ones related to symlinks. And you must do this in a hook of the dired buffer, before fontification happens. There exist `dired-hide-details-mode', which I don't know. Perhaps enabling it in time would do the job? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 11:47:58 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 15:47:58 +0000 Received: from localhost ([127.0.0.1]:53908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbBl-0007Jk-RC for submit@debbugs.gnu.org; Fri, 06 Sep 2024 11:47:58 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:49457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbBk-0007JV-DJ for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 11:47:56 -0400 Received: by mail-ot1-f66.google.com with SMTP id 46e09a7af769-7091558067eso1056701a34.3 for <73046@debbugs.gnu.org>; Fri, 06 Sep 2024 08:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725637611; x=1726242411; 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=K6r66MZDMDzAYFJ7E2wHe6CxlEB/vxq6YlXHmDcKQD4=; b=ilPP5mr+H8k0kzy1NaKXxu5MmuDbiwWFgxLNqFht0uza7KQ096vedEHheOmZ/6PLTi 3eeAX21sfcNaALV3I8egf/e5diDBLX06Skf0y9TDcj+bNSm9YidsEIFq0XD2gnCr8NLS sWhUpzeV4baqOqsjZyYit6Q0CyskYcZWXQbIy3Nc1n78ljFTSNBPB+gAglBVISha3RqL 9NkmrTNyPPwCQtqjwFVlQ3FJaugbqaPWLDMUlh0V+sMKe/1eQ79Eso3YKahHmq5yZXqc Uu17NaE/Oic3Os13KtM2rJmQu/dRGe0/vAXQPbjIQHC97Ty1u7+YdrncCeM/CA9lvo5W CPqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725637611; x=1726242411; 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=K6r66MZDMDzAYFJ7E2wHe6CxlEB/vxq6YlXHmDcKQD4=; b=mxUnaYFlZ3QGICHTmyZOI+c9HGNxot5/2ULhpQv5Be/ceBRPSvjrsbJzt8lwh9Bybk DdscfIG0vhwgJ+zp1zGOhAuYk6kQSvjmaUcLIb9JAn/bsvgmcK2noKViIbLmSS6vNOls RcW/EkfXWcVFYmkf1xsQcUSnas2M5HyJkL8sHQHUZ6c+K88NH7raMvM9qyZd2/i/CD/i GoWdJTETIhhaeeP5M6YJF/lhnHR7O998xPKQML8ix2jAWJdz/yvz0gbZgRJcGMwn+KF7 670iJzZaIO9O8gGGz1HnaLXZbljNfP+fpQOVkwL61y8JleCIln84/TBuBtFhjLtaJNRo Mosg== X-Forwarded-Encrypted: i=1; AJvYcCWN/QV9MERY0ddXpoOcycB8Y6PsuTeYRw1Ms4jugfkLp8xqUs2HR1dAVimwNa7bQ2P6EK8YpQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwWPSq4z09bXhdcC1XVWJesRRCfH4AwWp0oGLkM1b57oYtuXW1w 6zSxA0Me2mBV9LBG/EJjrxIoty0qcm4idf9U8mqWJpllM0MITi9NR1T60w+Z X-Google-Smtp-Source: AGHT+IE9WNqpkTqDSTfrkE+3oUnZ1aOwh9vFaMmo5gxjh88dg8I5uEVOeAXzccnVb6O5yI0s/Dz3tQ== X-Received: by 2002:a05:6830:2d84:b0:70f:7a86:f396 with SMTP id 46e09a7af769-70f7a86f4cdmr19888150a34.0.1725637610758; Fri, 06 Sep 2024 08:46:50 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45801a152e0sm17064871cf.13.2024.09.06.08.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 08:46:50 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <8634md2vc2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Sep 2024 08:40:45 +0300") References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> Date: Fri, 06 Sep 2024 11:46:39 -0400 Message-ID: <87cylghjj4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: >> The version of `ls' on this host is: >> >> #+begin_quote >> ls (GNU coreutils) 8.32 >> Copyright (C) 2020 Free Software Foundation, Inc. >> License GPLv3+: GNU GPL version 3 or later . >> This is free software: you are free to change and redistribute it. >> There is NO WARRANTY, to the extent permitted by law. >> >> Written by Richard M. Stallman and David MacKenzie. >> #+end_quote > > This cannot be true: the --dired option was added to 'ls' way earlier. > I have Coreutils 6.9 from 2007 on one of my systems, and --dired is > supported there. To see if it is supported, try this: > > $ ls -al --dired > > You should see 2 extra lines of output after the listing, each one > starting with "//DIRED". I understand that said version should have had --dired support, but that's not what I observed. Regardless, I got the sysadmin to do an upgrade and now `ls --dired' is giving the expected output. However, the performance issues still persist and continue to be reproducible on my end via emacs -Q. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 11:53:37 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 15:53:37 +0000 Received: from localhost ([127.0.0.1]:53920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbHF-0007cP-6C for submit@debbugs.gnu.org; Fri, 06 Sep 2024 11:53:37 -0400 Received: from mail-oo1-f68.google.com ([209.85.161.68]:56567) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbHE-0007cD-6D for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 11:53:36 -0400 Received: by mail-oo1-f68.google.com with SMTP id 006d021491bc7-5d5c7f23f22so1289269eaf.0 for <73046@debbugs.gnu.org>; Fri, 06 Sep 2024 08:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725637950; x=1726242750; 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=H6Vt4ohcdesdhqqp7kthVKV/wm9HSIOs/9oCsNjXOKE=; b=L6k91KExqmNu2/VzOE+9+Ssnqd9J7TZCqAhNggquZGifAKGLs1D3/nhS7X/cBKNyIp dLezzWlVPt8byO+j3suE5aI42jvUpi2Gz4SZGzWsjmgdXgNwalRIoZy1CzLDjN0HLf79 GgHzz1s6jfYPJZMYy+QDRQcNb45jT4ZJLXcDPyiaKtIQ6iFVdxx058e+R4xucTPPt8Ir aXZ5bhg23MQwGxfcOfejN8f8o3Dkp4nJRGE578uJshJlcAvAT2QVNTv6E2gJfbg2AqsY 1fJuJYJM1Nsfr0gDTYksHXPRqHA/ZVp36Jr/5pEqJcV2Em3tw6KQs+CYNev9yxF7eBPz BxlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725637950; x=1726242750; 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=H6Vt4ohcdesdhqqp7kthVKV/wm9HSIOs/9oCsNjXOKE=; b=l7Ff6BW7jEhmBKahaNSOZPb9VVg77hrKxT/17Qdx7pg1Ut/COBp29REY0ua9pTtPT1 tY3JuiwUe5oL9A291YE1JNMpNna45p/7d+O+w9zfETrCqR3LoWwYgrcU8vrYiRu8On5q Hb9Ba5OMoOuyCWDod2vWy9xnUM75X4P1LZkwJgHIZRzed8WIKiYgFji4C2wGBHSosiTZ BBuholpSX4zjnpuwZR2JlvYxTM+utEMtAoiyfRHAApLPbeH/k/7no6pJz0wvwmmwouYP HnMDA78Tu0i6WfjUJVlU08o1LLBy8AR7xR1PnzkANJqNbb+eizAQw69npxXEVy6pjlKc FWpw== X-Forwarded-Encrypted: i=1; AJvYcCU8AclwsfdtcKLE8J13wrAnYuprtgEuRMSc9z/IELpUOE+re8+lHpkKsxe1BLNwVyO5r0NjOQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzi9297TiV/xa57I2TvwfEYOqrClOt3ShE61p4kKukHsG9Udy69 7rp2MJlDfC+QaLZ5QI99MDAmfLZr2oyrYKaCPX15uYLd38d4zj1084NvnwiD X-Google-Smtp-Source: AGHT+IEkOKDPP7Zk9Kmb7/+fANlUdC3GKy7B1cuM3nmJr5vF1RRu2whY9PCuGZIDWhxQegfJYER/4A== X-Received: by 2002:a05:6870:8a11:b0:25e:14e9:10c9 with SMTP id 586e51a60fabf-27b82db89fcmr4046434fac.6.1725637950464; Fri, 06 Sep 2024 08:52:30 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a9a2100c01sm6812485a.29.2024.09.06.08.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 08:52:30 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <8634md2vc2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Sep 2024 08:40:45 +0300") References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> Date: Fri, 06 Sep 2024 11:52:19 -0400 Message-ID: <8734mchj9o.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: >> Based on =profiler-report=, the following function "chains" consume most of the >> CPU: >> - `font-lock-fontify-keywords-region' >> - tramp-sh-file-name-handler >> - tramp-sh-handle-file-truename >> - `tramp-wait-for-regexp' >> - tramp-sh-handle-file-exists-p >> - `tramp-wait-for-regexp' >> - tramp-sh-handle-file-directory-p >> - `tramp-wait-for-regexp' >> - tramp-sh-handle-file-attributes >> - `tramp-wait-for-regexp' >> >> As noted previously, disabling global-font-lock-mode helps. > > FWIW, I cannot reproduce this: I tried Dired on a remote host with > which I have connection that is quite slow, and saw neither high CPU > usage nor a significant delay in displaying a Dired buffer. In my case, the directory in question had 22 symlinks. How many symlinks did you try with? -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 12:02:48 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 16:02:48 +0000 Received: from localhost ([127.0.0.1]:53998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbQ8-0008ET-Da for submit@debbugs.gnu.org; Fri, 06 Sep 2024 12:02:48 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbQ5-0008EC-MB for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 12:02:46 -0400 Received: by mail-qt1-f193.google.com with SMTP id d75a77b69052e-456850b370eso13572001cf.1 for <73046@debbugs.gnu.org>; Fri, 06 Sep 2024 09:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725638500; x=1726243300; 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=gNei6m+ksh+f/pVKVdhhLazGE3zPeEdH60JWvzgsFAc=; b=da4C90+fggVShr9qxay2cCBzqjdfZYfXIiT+bSw9p7IAJO430lgh7NXSsJX+eteMJ0 Yb1yn1gOe/YIGXPv2l0A44YOeUQO6R0rlkk72dJNUDWSLWOeBWzIk5bF0TwGAHQSl7bX 4r8I3g962Go4rFr2IEBAtXHxgIKRDzHIC2AMc0YdZMpX7/gR8UoTWYTGSBHpQI10/0yb xHY7nluHPTIqDylZOreDPV1NyEupRVlAJOZcSjKwACSdwgVKYbLJ7nXPccdWIgQhpKjJ Px2aO3pmbshMQmKBuHoWPWYs9a/IZGkAVdrqHIwHngaaifIY9MXhsc/SwerSog28KMkT Il1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725638500; x=1726243300; 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=gNei6m+ksh+f/pVKVdhhLazGE3zPeEdH60JWvzgsFAc=; b=YHfDTsHFe+LyCcjkzJLWuPhoNHgpHz7eD2EXS/hbKqU5Z92Yxm7qpRCN3xGRryZlLM BW014YrGkNf96M/VKg8K4pY5TDQU9JMXuxwW7OybVbI7xSi+HphsMkq07y/WHpgkbOP1 f8qJApeovg7Mgsu3pQSSAV+Wd5X+5LhurgrSI9fbDXf+GYAewdp2PR6bWyKLURjm4vmB NN64HJLWXZcbVjIXkCYpnqF3iuTtJVU2zXjqw3Y+FFsWZmm6VGo5WrGir68CIrQAA9IX uOt1dftTK9Ys3Oab7A4ptMgeB3e4U7+wyHXv80wVZtK2H3cKMD5wgVt6RsY4cdNOei/w 80IA== X-Forwarded-Encrypted: i=1; AJvYcCXi5j5vGd/vYu1llgzl8kZi89TjMQbpQmzmmeZ8+Zl0T/eL6UyL54e96uddknJW+uamyVAs6A==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzLQkBWHMoc+nx03kKdjSAe/tzxElKDjPw+11RDaJSnrIhcbtCJ ivbCeSjstv+xBYhdXYau5DMDmxUK+12WpEV6IB6TnI4rYONWwcTCwVLM5UUQ X-Google-Smtp-Source: AGHT+IEx8pSAOHrw4KWJL57IyOtM5cvLYhpm/IgWgiRzUff9PuYL7zLVDvFUgVywwystaUmQRgsSgg== X-Received: by 2002:a05:622a:20c:b0:456:7529:71d with SMTP id d75a77b69052e-4580c6719f2mr37828801cf.9.1725638500084; Fri, 06 Sep 2024 09:01:40 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45801dc1824sm17206581cf.86.2024.09.06.09.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 09:01:39 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87h6asrk42.fsf@gmx.de> (Michael Albinus's message of "Fri, 06 Sep 2024 15:23:57 +0200") References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> <87h6asrk42.fsf@gmx.de> Date: Fri, 06 Sep 2024 12:01:28 -0400 Message-ID: <87seucg49z.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: >>> Based on =profiler-report=, the following function "chains" consume most of the >>> CPU: >>> - `font-lock-fontify-keywords-region' >>> - tramp-sh-file-name-handler >>> - tramp-sh-handle-file-truename >>> - `tramp-wait-for-regexp' >>> - tramp-sh-handle-file-exists-p >>> - `tramp-wait-for-regexp' >>> - tramp-sh-handle-file-directory-p >>> - `tramp-wait-for-regexp' >>> - tramp-sh-handle-file-attributes >>> - `tramp-wait-for-regexp' >>> >>> As noted previously, disabling global-font-lock-mode helps. >> >> FWIW, I cannot reproduce this: I tried Dired on a remote host with >> which I have connection that is quite slow, and saw neither high CPU >> usage nor a significant delay in displaying a Dired buffer. > > 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. I agree. Having a user configuration(s) that allows one to selectively disable some of the possibly more expensive checks would be valuable. If that were available, user configuration code could determine their own rules or thresholds as to when those options should be toggled (without disabling font-locking in its entirety). If performance degradation could be dynamically checked by Emacs (something akin to so-long-action and so-long-predicate, but for this instance of font-locking instead) that would be ideal, but it may not be easy to implement and it certainly isn't necessary - when things get unresponsive, it's pretty apparent. > And no, the checks shouldn't be suppressed for remote directories in > general, on a fast connection they are valuable. I agree. > In bug#17064, the impact of these calls where discussed. The conclusion was > >> Or could this have any bad side effects? Is it maybe too heavy to call >> `file-truename'? > > Normally, there aren't many symlinks in a buffer, so I think the > performance impact would be negligible. > > Likely, this was too optimistic ... For the host where I noticed this issue, the directory in question had 22 symlinks. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 12:09:31 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 16:09:31 +0000 Received: from localhost ([127.0.0.1]:54022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbWd-00008e-Gj for submit@debbugs.gnu.org; Fri, 06 Sep 2024 12:09:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smbWb-00008P-Jm for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 12:09:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smbWW-0001y4-NK; Fri, 06 Sep 2024 12:09:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5t3r4mYV6YZ8YAdWgBGjwbJ/MYNJFod9toxp3MzKPpU=; b=IIa86U65x2Iz /9Ip+K8o5YCmzwHyhuhb4EOkaf3iSfzpe4+EmhYXU8+3pfMgL9u2D2Eh9004eo9hjqFb/AF4LoJ8v YxkCsdGKEIvPtZHiqDK1CGQr2uss2vT+4AeJqXmAYms8hfd1CeE+SBOUV11ZLdJmk1GZ6jn+nds7m U9DNJgwfbRPFmOx43xns3CATNJj4JJB9soAwgQhPlSgUuEfTEb4OwtP6QP6LPLPMfwf2YSwrlO2ZP rGJzlYgMN03nxuf4ldBmRIZfxkV8Db2lROPwiLFATWr1FDVvCYsrz83eM54HjyxQIEafTnv6m97+t Rq3WvuRtoYm8oUGzrcd9BA==; Date: Fri, 06 Sep 2024 19:09:22 +0300 Message-Id: <865xr8228d.fsf@gnu.org> From: Eli Zaretskii To: suhailsingh247@gmail.com, Michael Albinus In-Reply-To: <87le0450x8.fsf@gmx.de> (message from Michael Albinus on Fri, 06 Sep 2024 16:09:23 +0200) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org > Date: Fri, 06 Sep 2024 16:09:23 +0200 > > Eli Zaretskii writes: > > >> 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'. > > > > But font-lock is ON by default, so what I saw also includes this, > > right? > > Sure. But we don't know the exact setting of the OP. The connection > could be extremely slow for him, Tramp's cache might be disabled, > whatever. Perhaps it's worth to rerun the test with "emacs -Q". I think we should also try to establish how slow is that connection. How much time does "ping" take? How long does it take to fetch a file of, say 20 KBytes? Also, if font-lock is disabled, does the problem go away? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 12:57:45 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 16:57:45 +0000 Received: from localhost ([127.0.0.1]:54100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smcHJ-0002u0-Bn for submit@debbugs.gnu.org; Fri, 06 Sep 2024 12:57:45 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:59823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smcHH-0002th-6a for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 12:57:43 -0400 Received: by mail-qv1-f66.google.com with SMTP id 6a1803df08f44-6c35427935eso12551566d6.3 for <73046@debbugs.gnu.org>; Fri, 06 Sep 2024 09:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725641797; x=1726246597; 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=Zt7+76sfSm8pvGgTLzda3ORLbVa2QERCY8kd8JIRWFs=; b=jaPKCo1L/d6sKIAuphQ1egKD1qgbG+cm+pVGjSgHYF4+nt0LPa9RRt9TVpLLkBRNKo hIkf18So6HCq/2Cla+wpQL0NwdAwank0nvX9kk+91xxw+uLwGXCJ6zSov66UaqJppyRH jdlWvSB4WzvgCWeZRJrqgOwu8SpdfgFYe1bwtulU0+HmqmjZEs74NTMUQO1kWe0vGbr9 AnyFryRLMilm7QGbo1BoivBLjIULR9QzN61mwRhC4akmOSuZB20Ijmz0oPF97O4GCu0O gSQVvJsLb23n7LuhARo3yswcC4ovFJ9hxm/b19OYqeA6+v4oYn2XsmbsXnNPSgGyA00f 291Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725641797; x=1726246597; 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=Zt7+76sfSm8pvGgTLzda3ORLbVa2QERCY8kd8JIRWFs=; b=WW6kUqprGqt9dxWmf1O2aniq+jF78Rw1Ujl0VayJX9AMFjfE+r/opilzLWkzomFRHh 7Oi4LmPuCwsp7/bWashroQaF6i9MDZ19pB1hl8rkeEH5wuJUl0UW1equt64680T4ZldY 3I6+2MpHj/rSqkYAyynHiIQi8CHdmUxVzD1lTC495fOTu2Uu/XhI2chGnyVymMUQ0K6Y naShNorEFOb3tPYXa+1pV3kBdQxuEB4CuiOMzKczDmVVq/bkJHSo4oprRdolSG3SGW/8 MHrhnzT6b+MV7ppR05cyuMGxdFnceQqA4LFVbr4W5Fbi3kN6PgQrznHACZNAIVs/mm9d ZggA== X-Forwarded-Encrypted: i=1; AJvYcCU2phH+iTNf0Sh+EE4irEw1hIhEg+9COU5/FUjV7zThQFJSBjEDy+/2MiZUTPYWJJCTg6912A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy2MEqJwa1FxNL4Iuyy8hzhRcVhsuIdQDG34CxVsLrV+27oO+0R R4igj9sXyfHw6R5i3xHYAAqWu9lLUWfuT6USn7OSMnjgEpZMJAJBIGRMpQDg X-Google-Smtp-Source: AGHT+IEUSKYajLyAsXGPJMcxZcWHs3hn7U8au4ZucoYzkyKrEzYg/4WRsXzF1tKu+OJJURfa5+35+w== X-Received: by 2002:ad4:44a1:0:b0:6c5:caa:dd83 with SMTP id 6a1803df08f44-6c52850bb7fmr33905266d6.41.1725641797313; Fri, 06 Sep 2024 09:56:37 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5201e415fsm18090086d6.33.2024.09.06.09.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 09:56:36 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87le0450x8.fsf@gmx.de> (Michael Albinus's message of "Fri, 06 Sep 2024 16:09:23 +0200") 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> Date: Fri, 06 Sep 2024 12:56:26 -0400 Message-ID: <87o750g1qd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: >>> > FWIW, I cannot reproduce this: I tried Dired on a remote host with >>> > which I have connection that is quite slow, and saw neither high CPU >>> > usage nor a significant delay in displaying a Dired buffer. >>> >>> 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'. >> >> But font-lock is ON by default, so what I saw also includes this, >> right? > > Sure. But we don't know the exact setting of the OP. The connection > could be extremely slow for him, Tramp's cache might be disabled, > whatever. Perhaps it's worth to rerun the test with "emacs -Q". The issue was observed with emacs -Q on a remote directory that had 22 symlinks. On the affected host, I am able to reliably reproduce the issue by evaluating the code below and then navigating to /tmp/test/links in dired via TRAMP. #+name: perf-fix/tramp/font-lock-on-dired/reproducer #+begin_src sh cd /tmp rm -rf /tmp/test mkdir /tmp/test cd /tmp/test for i in `seq -w 0 21`; do mkdir -p src/"$i" done mkdir -p links cd links for i in `seq -w 0 21`; do ln -sf /tmp/test/src/"$i" done #+end_src Notably, for the affected host, the issue is reproducible using above even after a new OS install. However, the above test case doesn't cover all variables affecting the issue. Specifically, when I run the above code on a different host (with faster connection and fewer hops to get to) and navigate to /tmp/test/links the severity of the issue is much less. That being said, the profiler reports (starting from emacs -Q and after establishing connection with host in question via TRAMP) for both the affected and not-as-affected host are similar. I believe the issue is present on the unaffected host as well, but with much less severity for some reason. My guess is that connection speed (in addition to the number of symlinks in the directory in question) is a determining factor. I am speculating here, but perhaps TRAMP is busy-waiting for a response? That would be consistent with what I observe, but I am not sure how to verify that. >>> I believe it would be helpful to suppress these checks via a user >>> option. >> >> What's wrong with "M-x font-lock-mode RET"? > > You would deactivate all fontifications, not only the ones related to > symlinks. > > And you must do this in a hook of the dired buffer, before fontification > happens. Yes, precisely. That is my current workaround. It's far from ideal, but it at least allows Emacs to be in a semi-workable state. It would be much better if there were a way to suppress only the "expensive" font-locking checks in this case. > There exist `dired-hide-details-mode', which I don't know. Perhaps > enabling it in time would do the job? It, unfortunately, doesn't help. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 13:49:14 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 17:49:14 +0000 Received: from localhost ([127.0.0.1]:54132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smd57-0005eK-Tr for submit@debbugs.gnu.org; Fri, 06 Sep 2024 13:49:14 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:44155) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smd55-0005e3-At for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 13:49:11 -0400 Received: by mail-qv1-f66.google.com with SMTP id 6a1803df08f44-6c35334dfb1so12695386d6.0 for <73046@debbugs.gnu.org>; Fri, 06 Sep 2024 10:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725644886; x=1726249686; 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=H2Iy3oDnKNRqrZEsIPmTlihkptkBPx2pCmdcXs+y/UY=; b=K8AmJsA5ET34r58pO/EdM8BMd8PJgD1J7Y4nk8RzsTNUaICanWwof1CYcIHcy+1RSf lHULZi5JM6tGR3BcQzeb4OrMM7ucUhQqsWoNfZgeSuHXyP4fa4p7RL2Ljg8mNHring3H hO/mcVlRyQWo9m4nxYoR87PoqYek/J/p33KSEvtUUI0X3HHlL9LV/OrTRSZRhsqN9YgC tHjannNLxAxHHmea3c7DAz+7uUPbJYTdpR+1aYHLphuvj+tICg1L36ly3dHArbr/ZupH /s9lxOw+SbtfiI/KUgiToLxAoH62C/rAucYRgQ9RcCWHvRmFWuGR6yA/vW3DARNA//Nk GpGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725644886; x=1726249686; 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=H2Iy3oDnKNRqrZEsIPmTlihkptkBPx2pCmdcXs+y/UY=; b=WxWBBi9/XqdVyvHXcQ4FSawZiW46Hi2vc41tCTmys3HUbNdElCydlexkIlwUKNHnzP p9kuwtkWvWUv+AlIP71Dqm8BBsUMjRYqUqq/6Ggd7NS9ftcLKhEbfIN1bg6ng3Tns+gh qIStdv7s+/eNk4XTQLyeKQIlOsKIcQbqHeCckzrQZUAR1ofXXeHkJaa4yvu++lt/GDxB ibXdC1VvrbobgTFZrCBFkUykI8XNresdEZ9PRBoVOntBhuVKpaaIm3pV/SoGxD4wET51 +7t7YeZ4jByg0GTZ3NP3TGw8pIfXSumHfQ9HhtVRdygDaJKB5N+Xa8qiXB/u0XVV4J63 Wr8Q== X-Forwarded-Encrypted: i=1; AJvYcCUkxkH3gs/9dUdrj3+aYjREtI+Pyo7j4HrtlvOdLfhfOg8w3K14RMeSNKjPI5ClUS71kaLzwA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzsvblhASJqclWJ8xw0aX1DHY4JS7GNWQFmkvbtNtqWikr6m3DU 9RiBKrviwlhF93z4YQx6cZ6AbxC1pSgs+MR1W7ko9sEY6N7OROIURgHKEkL9 X-Google-Smtp-Source: AGHT+IE5UtSxpJmtzWZlTanD8w9Kd2RM7JqTgwJdcXITzUfm7ileC4buQWbTqF4m/gzh6FEYRYs47w== X-Received: by 2002:a05:6214:4607:b0:6c3:62f7:9458 with SMTP id 6a1803df08f44-6c362f796acmr223545896d6.22.1725644885779; Fri, 06 Sep 2024 10:48:05 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5202de92asm18490856d6.74.2024.09.06.10.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 10:48:05 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <865xr8228d.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Sep 2024 19:09:22 +0300") 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> Date: Fri, 06 Sep 2024 13:47:54 -0400 Message-ID: <87jzfofzcl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Michael Albinus , suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: > I think we should also try to establish how slow is that connection. > How much time does "ping" take? The server doesn't respond to "ping" requests so I cannot test that. There are however more than 14 hops as reported by mtr. How much more I cannot say, unfortunately. > How long does it take to fetch a file of, say 20 KBytes? Given a 20kb file generated via: #+begin_src sh :results verbatim mkdir -p /tmp/test cd /tmp/test dd if=/dev/urandom of=upload_test bs=10k count=2 du -sh /tmp/test/upload_test #+end_src #+RESULTS: : 20K /tmp/test/upload_test It takes ~4-6s to upload: #+begin_src sh :results verbatim cd /tmp/test { time scp upload_test scp://${affected-host}//tmp/upload_test } 2>&1 #+end_src #+RESULTS: : : real 0m4.255s : user 0m0.008s : sys 0m0.002s And a similar time to download: #+begin_src sh :results verbatim cd /tmp/test { time scp scp://${affected-host}//tmp/upload_test ./download_test } 2>&1 #+end_src #+RESULTS: : : real 0m5.638s : user 0m0.007s : sys 0m0.000s > Also, if font-lock is disabled, does the problem go away? As noted in the original message: >>> Disabling global-font-lock-mode, makes the situation better. Things are still sluggish after disabling font-lock, but they are *much* better (i.e., instead of a ~10s delay for revert-buffer we are down to less than a second). The remaining sluggishness seems reasonable given what I know about the connection speed, but I have not done extensive quantitative testing. As such, while I cannot say with certainty if "the problem" goes away entirely, or only mostly, it does improve significantly. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 15:30:58 2024 Received: (at 73046) by debbugs.gnu.org; 6 Sep 2024 19:30:58 +0000 Received: from localhost ([127.0.0.1]:54221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smefa-0002rn-0Q for submit@debbugs.gnu.org; Fri, 06 Sep 2024 15:30:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smefW-0002rS-TE for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 15:30:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smeJl-0002EW-Dl; Fri, 06 Sep 2024 15:08:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=bxVAqRSHzQQRfKK6t5yCcRdarMPWKIy1mS8aSlSrWGA=; b=RWD8HUKoQYyW DIfq6tynZsDZWsu4iWCqxjx2PX2lPdi9b3DAlXnbEBK2hLqkfRiVmtAi6Nc+sSHeZSODBHUUk2fZl lZbU0rzhUfB6NlSLF3XogjdWAjsAk5TDXj5NmB9hDT5V3jdSVTYCyGeZZVYbs9ou0oRsrUuQ324qy ATy/uhntofKpeIsjKGMcqol6fjW+owF6oT1qv0UJzGOee1YiSj9eo4HzcKWHCA9WylOeBuYWLe17+ cg1OkqoNr2/IAUcu0Hprk1zIrwMOQe8Idtx+TrcSZ88zwfluxwNZ2Xb8F00x1IyVJ/oLndGWD5ntb /K6AbM2vV9NlnCrevW7JcQ==; Date: Fri, 06 Sep 2024 22:08:23 +0300 Message-Id: <8634mc1ty0.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <87jzfofzcl.fsf@gmail.com> (message from Suhail Singh on Fri, 06 Sep 2024 13:47:54 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: suhailsingh247@gmail.com, Michael Albinus , > 73046@debbugs.gnu.org > Date: Fri, 06 Sep 2024 13:47:54 -0400 > > > How long does it take to fetch a file of, say 20 KBytes? > > Given a 20kb file generated via: > #+begin_src sh :results verbatim > mkdir -p /tmp/test > cd /tmp/test > dd if=/dev/urandom of=upload_test bs=10k count=2 > du -sh /tmp/test/upload_test > #+end_src > > #+RESULTS: > : 20K /tmp/test/upload_test > > It takes ~4-6s to upload: > #+begin_src sh :results verbatim > cd /tmp/test > { > time scp upload_test scp://${affected-host}//tmp/upload_test > } 2>&1 > #+end_src > > #+RESULTS: > : > : real 0m4.255s > : user 0m0.008s > : sys 0m0.002s > > And a similar time to download: > #+begin_src sh :results verbatim > cd /tmp/test > { > time scp scp://${affected-host}//tmp/upload_test ./download_test > } 2>&1 > #+end_src > > #+RESULTS: > : > : real 0m5.638s > : user 0m0.007s > : sys 0m0.000s > > > > Also, if font-lock is disabled, does the problem go away? > > As noted in the original message: > > >>> Disabling global-font-lock-mode, makes the situation better. > > Things are still sluggish after disabling font-lock, but they are *much* > better (i.e., instead of a ~10s delay for revert-buffer we are down to > less than a second). The remaining sluggishness seems reasonable given > what I know about the connection speed, but I have not done extensive > quantitative testing. As such, while I cannot say with certainty if > "the problem" goes away entirely, or only mostly, it does improve > significantly. So if it takes 4 to 5 sec to move a 20KB file, then how much stuff needs to be moved for the Dired listing? What does the below show, if you run it on that remote machine? $ ls -al | wc It needs to show around 40KB to explain 10 sec of delay. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 20:20:54 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 00:20:54 +0000 Received: from localhost ([127.0.0.1]:54411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smjCA-0002HE-9T for submit@debbugs.gnu.org; Fri, 06 Sep 2024 20:20:54 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:56443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smjC8-0002H0-0o for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 20:20:53 -0400 Received: by mail-qt1-f193.google.com with SMTP id d75a77b69052e-457e2537611so15544041cf.0 for <73046@debbugs.gnu.org>; Fri, 06 Sep 2024 17:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725668385; x=1726273185; 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=Yb95tMa3N/DtKzjYtzukYMsK39eI6vNVOM+li69v7bs=; b=d9ES5Mdrj/YTXjze1LSxDgqenn6PGAoADRtU7ZvadbhIfIjvevZM8LGEy4JJPzRH4w U846cyODiOfyCLqg5Bnq7Kl2TvqxiHuSEKedH/ATv4qwIzQhmO5/LF38q4PSBZAqb4tY 9SkqaF+3nPq7uKyhfIqCBMiioMebogsBnmqxWZLx8twERfm2PEqztSW2TnKuZUAgKXnK S4hEwIl0kPs3XaZfxAd8PzntPJi7+fiW20k8BRxd1RcVKgf36Yo+1aDXHoL3HPaQ+NQo 4Q93gJWNiJY34zcZlzuXMF9TxBrUpAPN62We+fQNNFelxZpoV+qq3jKbSlIsC9iEtknb 0NjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725668385; x=1726273185; 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=Yb95tMa3N/DtKzjYtzukYMsK39eI6vNVOM+li69v7bs=; b=Vdan8NQ6sC9Ft3JmXQk873w8/kCXRNhpOIyddL2jLjLvEiuotlRfzDMQ1yA/k2n4qw 5oOwOyGali+P6iptEO9JeeGiUOh1dF9/7DGH8Tj4rHHVjM5C3NG4ktsg7TJs6xpGsuI0 g0WF1LoTBtq1JnjJvgSqTB1IJcGGfcspIVHTUrE9uJ9i6XRblnJTDOsaCkVG+zUtyCmF T5idd7UyIrkWUe/eS68LObKIDOX8ypxRPUnrHmgdJ2fMuukT9fOHU5R1ndDB2yV3EuUz UCF/7QoOooB/22FM2wMetpf0E5x+1BsY/ZoyBV5K/3gOUi5ypNxhFcma8X6oc/y8iFwF oqzw== X-Forwarded-Encrypted: i=1; AJvYcCVdq9yqx526yDMpymhRECfN11FI75vu2v1Fy/tJZx4zQ4UAaOU8K+x07/zIGoY/fA3EU2pdtw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YypQwkcgCvCwp0Q+oztv0j/epSa76pXUeLgdaKnjgD3KOeto+s5 twdrVJHgQuHbT0PcptrYjUZ57f8oIY6WvzuEf82DI3K6K050QZvrXpOdPuuc X-Google-Smtp-Source: AGHT+IFTP7+UkC0CbQWaGSvf85wLpRBOsLely8yse6/jT1UF+d29o+ZbdMrz97dAc3/c4mVweHNf9w== X-Received: by 2002:a05:622a:1649:b0:44f:f11a:63bf with SMTP id d75a77b69052e-4580c744ec6mr36607051cf.41.1725668385453; Fri, 06 Sep 2024 17:19:45 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822f61ac7sm149311cf.71.2024.09.06.17.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 17:19:45 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <8634mc1ty0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Sep 2024 22:08:23 +0300") 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> Date: Fri, 06 Sep 2024 20:19:34 -0400 Message-ID: <87h6asl3hl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: > So if it takes 4 to 5 sec to move a 20KB file, then how much stuff > needs to be moved for the Dired listing? What does the below show, if > you run it on that remote machine? > > $ ls -al | wc Given that the contents of the remote directory can be exactly replicated (apart from metadata such as mtime etc) by the below code (that I shared in another response), you should be able to answer the question trivially: #+name: perf-fix/tramp/font-lock-on-dired/reproducer #+begin_src sh cd /tmp rm -rf /tmp/test mkdir /tmp/test cd /tmp/test for i in `seq -w 0 21`; do mkdir -p src/"$i" done mkdir -p links cd links for i in `seq -w 0 21`; do ln -sf /tmp/test/src/"$i" done #+end_src For the record, the output is as follows: #+begin_src sh :dir /ssh:${affected-host}:/tmp cd /tmp/test/links ls -al | wc #+end_src #+RESULTS: : 25 262 1599 > It needs to show around 40KB to explain 10 sec of delay. I don't understand your reasoning. In fact if the output of ls -al was indeed around 40kb I would have been very surprised. The time taken for transferring the 20KB file included initial connection costs whereas TRAMP would presumably be reusing the same connection, but would be sending multiple small requests. I don't see how one can be compared to the other, other than to say (generally) that when connection is slow both workflows would take greater time (which is what we observe). Note that disabling font-lock improved response delay considerably. That means the delay is not due to transferring information contained in `ls --dired', which is considerably fast (relatively speaking), but in doing the additional checks that Michael mentioned: >>> 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 did some further investigation; summarizing findings below: A. On Host-A, the network connection is fairly slow s.t. transferring a 20KB file takes ~5s. On Host-B, the network connection is fairly fast. B. On Host-A, the time taken to refresh dired buffer containing 22 Subdirectories (/tmp/test/src as in above code snippet) is 0.70-0.75s with font-lock enabled, and about the same with font-lock disabled. These times exclude the time taken to establish the intiial connection over TRAMP. C. On Host-A, the time taken to refresh dired buffer containing 22 symlinks (each symlink pointing to a directory, i.e., /tmp/test/links in the above code snippet) is 0.70-0.75s with font-lock disabled. With font-lock enabled the time taken is ~13-14s and the CPU is at 100%. These times exclude the time taken to establish the intiial connection over TRAMP. D. On Host-B, the time taken to display dired buffer for /tmp/test/links with font-lock enabled is ~2s greater than when font-lock is disabled. When /tmp/test/links contains 100 symlinks to directories (instead of 22), the time taken when font-lock is enabled is ~6s greater than when font-lock is disabled. Given above, I conclude: 1. The issue is present when there are symlinks to directories. 2. The issue is worse when there are greater number of symlinks to directories. 2. The issue is worse when the connection is slower. However, it is still observable when the connection is faster - if you're having difficulty reproducing, increase the number of symlinks to directories in /tmp/test/links above. 3. Given that when connection is slower, not only is the time taken for font-locking greater, but the CPU is at 100%, I suspect that the relevant code is doing some kind of busy-waiting. The above observations seem consistent with Michael's comments above regd. font-lock checks for "Broken Symbolink link" and "Symbolic link to a directory". As such, if Michael's proposal below is implemented I believe it would be an adequate fix to the issue: >>> 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. I hope that clarifies things, and gives you sufficient information to be able to reproduce -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 06 21:40:31 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 01:40:31 +0000 Received: from localhost ([127.0.0.1]:54475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smkRD-0006oB-0q for submit@debbugs.gnu.org; Fri, 06 Sep 2024 21:40:31 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:59435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smkRC-0006nx-2R for 73046@debbugs.gnu.org; Fri, 06 Sep 2024 21:40:30 -0400 Received: by mail-qv1-f66.google.com with SMTP id 6a1803df08f44-6c34c02ff1cso15510356d6.2 for <73046@debbugs.gnu.org>; Fri, 06 Sep 2024 18:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725673164; x=1726277964; 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=SaE1ctZPEkNdgX4963OQ7vvQkanj8StS2czSpb04Jzo=; b=mrB9xOx99Vx2V4UpWC5OFghrnsgVcj51Ugo2EnfZzsltsrd72+jlM/SU2pMNZKSl4/ WsI9RXMnr+dm5hcbE++MryVWfHV9K1rCjoDxjYdgQ71GPwwmuok6w25oXXCNxSNwjODa dou/so+WxOGFHYaXZg7ZmoUavVD0NB/aQPV1E1rxdS3c52/vYXSKqr7fdUke8rT4tYAM YKoZKgY5nE3+wk5qW+5a1KOZ6ha1X9y4PL5g0p0v+4DUqThw+4hWHTQOFkbiHNJD7Eak Rv78euy1+gqhWwVfiB38GYcsmPSqdCFZPj19WGFKR5BRY4xTXXOVCxzF3tytt9/Ju+di DplA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725673164; x=1726277964; 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=SaE1ctZPEkNdgX4963OQ7vvQkanj8StS2czSpb04Jzo=; b=U/SjxJtlsbu+JS6qeVF3dU5s7rmX3LIsdnBP3dC4I7nyqNxY2TKA7bp4GC9k8dQk8i Ib2653WMYtAK+WJP+KCxBgJ/7E+iij3gqdko6sHn64+5wOoH93dVnbV9WARkf/P693hH BegdDEkdMz+FWhK59kOKVyrOwjChZQTqK3M9UejM44fWUYbMcO6UIp8Ht2umekzNyBkc oBlE2FHYKuz9dJDnzZ4yTL5ZKOW/GS5q79jgr3xUCpKrIj5IS2ehHsXyjAcbXqHdsvix x2qwXB0zIwTOcAeDKBmhP76+KC/ETaQD+Uk5R161LU/ozdN6WTlpU8acf3YTOiTir4Qs pHCQ== X-Forwarded-Encrypted: i=1; AJvYcCUBAzGrICuSz8c7jtWULKW4W9nEYMUUEgypQasMFmvorlnhJm7a3U6CuLUVB7h52IATRdtGvA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzJBTPB1kUk7u2qGvb0v9mMl/5vOLFp7ed9ayIckPLIGuCWZLof R58BMPSY1Px5YWGt3gg+Gj7a4nxPbH6ivnCGKasTreAAXt4Wkhr1d1Ehg+Ap X-Google-Smtp-Source: AGHT+IFLZf6l6UxKZKAOhV4DUYy+M/hvn1ryn0KRo9O6Guciybw4HGoOFOA87++Gfs/6bDZcfooi2Q== X-Received: by 2002:a05:6214:31a1:b0:6c3:5f15:b507 with SMTP id 6a1803df08f44-6c5282fb9cemr61870816d6.3.1725673163506; Fri, 06 Sep 2024 18:39:23 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c53474d749sm745706d6.92.2024.09.06.18.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 18:39:23 -0700 (PDT) From: Suhail Singh To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87h6asl3hl.fsf@gmail.com> (Suhail Singh's message of "Fri, 06 Sep 2024 20:19:34 -0400") 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> Date: Fri, 06 Sep 2024 21:39:12 -0400 Message-ID: <87bk10kzsv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , michael.albinus@gmx.de, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Suhail Singh writes: >>>> 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. For the benefit of others, absent such a user option, the below code works around the issue: #+begin_src emacs-lisp (add-hook 'dired-mode-hook (lambda () (setq-local dired-font-lock-keywords (cons (list dired-re-sym '(".+" (dired-move-to-filename) nil (0 dired-symlink-face))) (seq-remove (lambda (x) (string= (car x) dired-re-sym)) dired-font-lock-keywords))))) #+end_src I believe that the above isn't a fix, but simply a workaround since TRAMP awaiting a response over a slow connection shouldn't result in 100% CPU usage. Functions such as `tramp-wait-for-regexp' should not be using excess CPU when they are simply awaiting a response. >>>> And no, the checks shouldn't be suppressed for remote directories >>>> in general, on a fast connection they are valuable. For this reason, those interested in working around the issue in a similar manner as above, may want to add additional guards to the hook to ensure that the informative font-locking is suppressed (by modifying dired-font-lock-keywords) only when necessary. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 02:53:18 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 06:53:18 +0000 Received: from localhost ([127.0.0.1]:54607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smpJt-0007PA-Vt for submit@debbugs.gnu.org; Sat, 07 Sep 2024 02:53:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smpJr-0007OR-4E for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 02:53:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smowi-0007Or-8X; Sat, 07 Sep 2024 02:29:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/jOilDbSdbarDVgAdTTEQ/gZ++b5N/3lNhxvbxg1p68=; b=pr0WmCU+mbyn Cvj5NTi6NSKwGLpbaWSWkm2QEBk1E3wZjuefG7om1fvz93ltVgbzgNk7AOu0NRDleNODrdsmC0cFj SUr30kGUVzjIljGHEk/5slrqc4IOqNs9VVZzVtb+FRb9UcXMOyXKisS1gvJKeydv4fLdDLzv35DH3 CuuscipCv7Yh1tqcowyoDNpEoSOUzDQOzXxzfxI5x3N66wFVDVBgru78zcpqsZAT2SaRPccEDZA4+ UoTpxTdib46ZLSJqKiQSOf72f6NZW4TAhTNgAWXr9tskiEHX4dbchpSFKQD3BshAKJ5U9WWBZFWMP m8W49AaOVtL8ONYD8CoqxA==; Date: Sat, 07 Sep 2024 09:29:18 +0300 Message-Id: <86ttesyo1t.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <87h6asl3hl.fsf@gmail.com> (message from Suhail Singh on Fri, 06 Sep 2024 20:19:34 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: Suhail Singh , michael.albinus@gmx.de, > 73046@debbugs.gnu.org > Date: Fri, 06 Sep 2024 20:19:34 -0400 > > Eli Zaretskii writes: > > > It needs to show around 40KB to explain 10 sec of delay. > > I don't understand your reasoning. It's simple arithmetics: if fetching a 20KB file takes 4 to 5 sec, then the 10-sec delay you reported for Dired should mean we are fetching about 40KB of data. > In fact if the output of ls -al was indeed around 40kb I would have > been very surprised. In my home directory I get: $ ls -al ~ | wc 708 6371 43324 So a large enough (but not outlandishly large: just 700 files) directory can indeed mean Emacs needs to fetch 40KB of data for refreshing a Dired buffer. Which led me to believe this is not an impossible situation. > The time taken for transferring the 20KB file included initial > connection costs whereas TRAMP would presumably be reusing the same > connection, but would be sending multiple small requests. This just makes my argument stronger: it would mean that even 40KB data moved for Dired would not quite explain the 10-sec delay. > I did some further investigation; summarizing findings below: > > A. On Host-A, the network connection is fairly slow s.t. transferring a > 20KB file takes ~5s. On Host-B, the network connection is fairly > fast. > > B. On Host-A, the time taken to refresh dired buffer containing 22 > Subdirectories (/tmp/test/src as in above code snippet) is 0.70-0.75s > with font-lock enabled, and about the same with font-lock disabled. > These times exclude the time taken to establish the intiial > connection over TRAMP. > > C. On Host-A, the time taken to refresh dired buffer containing 22 > symlinks (each symlink pointing to a directory, i.e., /tmp/test/links > in the above code snippet) is 0.70-0.75s with font-lock disabled. > With font-lock enabled the time taken is ~13-14s and the CPU is at > 100%. These times exclude the time taken to establish the intiial > connection over TRAMP. > > D. On Host-B, the time taken to display dired buffer for /tmp/test/links > with font-lock enabled is ~2s greater than when font-lock is > disabled. When /tmp/test/links contains 100 symlinks to directories > (instead of 22), the time taken when font-lock is enabled is ~6s > greater than when font-lock is disabled. > > Given above, I conclude: > > 1. The issue is present when there are symlinks to directories. > > 2. The issue is worse when there are greater number of symlinks to > directories. > > 2. The issue is worse when the connection is slower. However, it is > still observable when the connection is faster - if you're having > difficulty reproducing, increase the number of symlinks to > directories in /tmp/test/links above. > > 3. Given that when connection is slower, not only is the time taken for > font-locking greater, but the CPU is at 100%, I suspect that the > relevant code is doing some kind of busy-waiting. Thanks you. So the problem seems to be symlinks, and specifically symlinks to directories. 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 04:09:12 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 08:09:12 +0000 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 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 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) 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) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86ttesyo1t.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 09:29:18 +0300") 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> Date: Sat, 07 Sep 2024 04:07:52 -0400 Message-ID: <87jzfnrinb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 10:23:19 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 14:23:19 +0000 Received: from localhost ([127.0.0.1]:57142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smwLO-0007p4-Vj for submit@debbugs.gnu.org; Sat, 07 Sep 2024 10:23:19 -0400 Received: from mout.gmx.net ([212.227.17.21]:48261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smwLM-0007oo-PX for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 10:23:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725718983; x=1726323783; i=michael.albinus@gmx.de; bh=hFP41xm+NUHHr3kU640yuXPjkYNRfOwClMfo6zR9dMM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=l+kL40JPiTBC/ogjp8heu4HRov2bc8RPKwke3ZMuhU2caIJO5bmIPfGnUKpUdliZ rpOPO5kFO3Z/rc3OQRJpvy1JihwEHp7NpcHEtTE1QkVCbPBdsn/IIbCz1/GmVrC7x qBnr+B19F+dkyDRl9UeOUz2IgzkBh5c+IaWL3KcIIZhw4EMVk1cSGK0ZhIQIMP+dN Fi0qN0MtwddFUwu2ef7+dkhX6UkiyWb6m8bTH7N7oysGG3X6cdBHtKN5O+cGsNMib Wk3gkTJ16B+rP3bKWpP/wWjI4UGQBpel+EE+kYOhOSi/Rs6TmDJwsY04ZRb9QFBUn jJEsvLT4iY8ks74yHQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MzQgC-1rrpRv0oCW-00vMKM; Sat, 07 Sep 2024 16:23:03 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87h6asl3hl.fsf@gmail.com> (Suhail Singh's message of "Fri, 06 Sep 2024 20:19:34 -0400") 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> Date: Sat, 07 Sep 2024 16:22:58 +0200 Message-ID: <87frqbk0fx.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:NV98g5FiYjSkREIsyrz+uwpKuTarWlV/grC0xnqUWA5ZaVmGHTi 7Wb0iRaXG8oSZjPBZDarR7auFRPCMUCc+YrTlJZrTbyenB+hT5h1+9SntOWhPGZbFAxp6Hd 9Rb5YMe3IuWVvsHBI3thHNLdHZTWdrr5Cvc5ikkJcvIQbQWXO1iEac0ZQfRATTof/GquPBE Jbtgyval2fguna8cxoHJw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:CWnTYAYwy5I=;V9HK2GkgoRwgW1WnU2/RjaztW8G ZMy2sLa8t75EKxX1G9MfHUyhKWTxpPvoxR1ZQuGAiB5HpierMTYxS+dyFb43wOROmlTu+TwPy TmesBdY6jcEgEKbycGJ0PLW8BwO97IiQhOq/I8znAfjR0CHNHG7mjtBjndswBtXSmeTQdLvZV /f1vKWYav4/a7+uRkK8qTDEWpJ0qOFIifL+sNb0g6V1IwNXZsNeq80iQX0f1HxdeVLsd1wCGY zrKRTYPG947GcjmV1N/udpccx05YtX+YN1dlbCn5/NYPWKkleZrgYspWI1GttvcU+3Hf9o3V/ eeDTvJ9JethuIz0vqR0qa5rhAfPwWRY2YYVFn8M3gPLVYF6BTc7oSP0sUm2bhpEZpP/nhR0Tn VdM443Vo+5/FIsnvzl7lqJ+21hCCSL20RGt99nt/soxTYL86B4mfVh0felHuQwW/9O0rt5avd 3poGxLanmSslczdpEa9tmRHSrXGOaBJLot5BafJciwZfNFWpTagCDWElUeQkkKhjfq0Jb1s7Q YiF/4QJYNVIG6YHRteD79Ggs9OikE88CpKusKDiPK+9hkBNmcxNPFKKje/Np8vOpD2qvXkSVL G0PT8fo/jsQa/UZIN3GX0s5taDSyB4q/mQYg7R4F8y8zokEIvLwXXGFDYfdt4+S4wfsdPkkdp qD1sAvAHDFMUU/kZvlsZVDzTTLNELs0p6YWqxs/7x4pB3aEDvC7OfP0/5vj9lQ3VtOhg0t1Tv UzVaX2EkBCDr6eMTSYTnKymI7DlpYn8nVHRWfHPuwcpgSfwJxzhTsKB0KlQKUi8pzp3eI5OS5 WAUtdZc9KJgBNYLZVWXCRBRA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Suhail Singh writes: Hi, > The above observations seem consistent with Michael's comments above > regd. font-lock checks for "Broken Symbolink link" and "Symbolic link to > a directory". As such, if Michael's proposal below is implemented I > believe it would be an adequate fix to the issue: > >>>> 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. I gave it a try, see appended patch. There's a new user option `dired-highlight-symlinks'. If non-nil (the default), symlinks are highlighted the same way as now. With a nil value, they aren't. You can switch this option on and off globally. However, it would be better to do this host-wise. For this, we have connection-local variables. The following code snippet in your ".emacs" switches the option off for the remote host "remotehost". --8<---------------cut here---------------start------------->8--- (connection-local-set-profile-variables 'my-dired-profile '((dired-highlight-symlinks . nil))) (connection-local-set-profiles '(:application tramp :machine "remotehost") 'my-dired-profile) --8<---------------cut here---------------end--------------->8--- Comments? Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/dired.el b/lisp/dired.el index 0d526dfc376..53d6d213951 100644 =2D-- a/lisp/dired.el +++ b/lisp/dired.el @@ -738,6 +738,13 @@ dired-ignored-face =0C ;;; Font-lock +(defcustom dired-highlight-symlinks t + "Whether symlinks shall use an own face. +Set it to nil for remote directories, which suffer from a slow connection= ." + :type 'boolean + :group 'dired + :version "31.1") + (defvar dired-font-lock-keywords (list ;; @@ -815,11 +822,13 @@ dired-font-lock-keywords ;; Broken Symbolic link. (list dired-re-sym (list (lambda (end) - (let* ((file (dired-file-name-at-point)) - (truename (ignore-errors (file-truename file)))) - ;; either not existent target or circular link - (and (not (and truename (file-exists-p truename))) - (search-forward-regexp "\\(.+\\) \\(->\\) ?\\(.+\= \)" end t)))) + (when (connection-local-value dired-highlight-symlinks) + (let* ((file (dired-file-name-at-point)) + (truename (ignore-errors (file-truename file)))= ) + ;; either not existent target or circular link + (and (not (and truename (file-exists-p truename))) + (search-forward-regexp + "\\(.+\\) \\(->\\) ?\\(.+\\)" end t))))) '(dired-move-to-filename) nil '(1 'dired-broken-symlink) @@ -829,10 +838,12 @@ dired-font-lock-keywords ;; Symbolic link to a directory. (list dired-re-sym (list (lambda (end) - (when-let* ((file (dired-file-name-at-point)) - (truename (ignore-errors (file-truename file= )))) - (and (file-directory-p truename) - (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" end t)))) + (when (connection-local-value dired-highlight-symlinks) + (when-let* ((file (dired-file-name-at-point)) + (truename (ignore-errors (file-truename fi= le)))) + (and (file-directory-p truename) + (search-forward-regexp + "\\(.+-> ?\\)\\(.+\\)" end t))))) '(dired-move-to-filename) nil '(1 dired-symlink-face) @@ -841,12 +852,13 @@ dired-font-lock-keywords ;; Symbolic link to a non-directory. (list dired-re-sym (list (lambda (end) - (when-let ((file (dired-file-name-at-point))) - (let ((truename (ignore-errors (file-truename file)))) - (and (or (not truename) - (not (file-directory-p truename))) - (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" - end t))))) + (when (connection-local-value dired-highlight-symlinks) + (when-let ((file (dired-file-name-at-point))) + (let ((truename (ignore-errors (file-truename file))= )) + (and (or (not truename) + (not (file-directory-p truename))) + (search-forward-regexp + "\\(.+-> ?\\)\\(.+\\)" end t)))))) '(dired-move-to-filename) nil '(1 dired-symlink-face) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 10:36:57 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 14:36:57 +0000 Received: from localhost ([127.0.0.1]:57152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smwYa-00008W-JS for submit@debbugs.gnu.org; Sat, 07 Sep 2024 10:36:57 -0400 Received: from mout.gmx.net ([212.227.15.15]:60483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smwYY-00008J-HD for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 10:36:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725719807; x=1726324607; i=michael.albinus@gmx.de; bh=rDAJWv9S6SA3h5sRZDN0F0spx9hFFVZcgsZ/VEPD6bA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=mi1wEnkPEkBIHR7HSRumFZbmq6FP5ty9s7C2xq0ODR7iTx/TsD81cTRJu6u+xsqv MmL7Jl4jtYhyvr8X4pBtArC7YSUuH4w8YR3UgFVQ4Gi2m4G3KM2krPNDSR9EtTRyx A6gHwY4x5KsUb46gjwaiSR96mKS+PdG3/RCiC6re9Lop2b1h9Xo4j38f/hXhvKxZJ s67Jqph6/iZkrP6QcDuiMIMI8kSwfD1hKjIO4dzRFTUA/9fIZHzJiyGoGQqCTPcTm ZSFLk9K48arTH3nsj9wZGTNPdnFKvaXzeclCByW45UOQEy2ApBjhtMMm848Ou7WLJ 89k5ITIznKcDhHQiuQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MEUzA-1spgd23OWo-001mT6; Sat, 07 Sep 2024 16:36:47 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86ttesyo1t.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 09:29:18 +0300") 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> Date: Sat, 07 Sep 2024 16:36:42 +0200 Message-ID: <87bk0zjzt1.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:HvDnuyaxFhE2VE46k3X0zebUmdF95ityuGAfkOtlvQaWhbnxsUf l5hNcl608/G5FhjZ73KBQCdY0zvioOH6tSdDok33ipJ8/8ijAjzYOciGO8aoDWQqjuiSSnJ cB54ShiAsd+MbpFTeUZvw/OZPv9K0CbNHFd3iIfx8mjNpHo5mWTQIgvBGNKFlhx/Ff6bTf5 F0bgkLybceJP2IzL4BxWQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Sxb8tLg+VGw=;DtJp6WgqGMdVK9JKcTysYKm2rwJ 9I7/N/79/Rr0mTzCg3XVit5vlrRIiRfx3bGa8R20B+b0uC4Gru2QuvSVius5jwNl4hSerts4E 1dyTIS0jFsUGejORV7g1jJzVx7TYkkEb2XNAMwW85ymn0UvHT7izfgzT0XqvmBD+UYa9cBcMb hEK+2/mK8TIaXvgldHpd/h4CU/r1M4iKP8A3FN0vd2MKAmX/kWnqy3eb4zXhJJ5jdxx6BV1K5 NkUE/kbAlY/iCg08uhVy4BKtBD3Tsdz+1Avw2EtMbBi8rIXf4dSFL9PSc4foVG7dgKq9XUsmV LI0exoB6aiTBVVGLAVFTkf6pkRkxmN3NyCFUiwBefumcvfrihxEiLpL0ZsfPaF7X3miWPkvQm WLyeb2fgiItODTAPgpE4v/RxJ+sAzmBAhY8O70QGYcdzkcRbaLf2Ck/+Uz24S+tY2SOayqMR0 xP38SqYgf/9ufw8IA+sjfglbEzRm7V7qa7zT3d+UJmUiROd2frk84QfXRaqKNFYRbUi+IxSNM y6PVpWmfr/uqtRTo2JotZBFcJP5mD3qaEvNqlW07iodAwvoY8gSitiuD4aPTkUzysxmYhEMWK mpfO1PKR+rgLC5rYSTVmxr+R/hfQ/cI2u7g8RKbrOPVHa+3+rNhhMAgdQqWGk4oNeRxkVDqDK bQlhDSMz0F8ntZfCyEqeyrwaCeRmzXxXiKqeAABvlaoVCOkOE2mNGoxa000LKJAr6o+mZPUWP BBfrXP1r5YXKZr2AZ6YMjE4BqecvSJygVuPhj2GuKv08/3wlogVvvRq+jHfpm8LfO6/eHReV0 BaZSR697bW0Uddk7YnrYwjag== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, > Thanks you. So the problem seems to be symlinks, and specifically > symlinks to directories. 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? I made a test. In a remote directory I have created a cyclic symlink "zzz", in order to see what Tramp does when running dired on the directory. The additional actions are --8<---------------cut here---------------start------------->8--- 16:26:26.596764 tramp-send-command (6) # test -d /home/albinus/tmp/zzz 2>/d= ev/null; echo tramp_exit_status $? 16:26:26.598277 tramp-wait-for-regexp (6) #=20 tramp_exit_status 1 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:26.601447 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:26.620202 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:26.621815 tramp-send-command (6) # tramp_stat_file_attributes_with_se= linux /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:26.701825 tramp-wait-for-regexp (6) #=20 (("=E2=80=98/home/albinus/tmp/zzz=E2=80=99 -> =E2=80=98/home/albinus/tmp/zz= z=E2=80=99") 1 ("albinus" . 1000) ("albinus" . 1000) 1725715198 1725627151 = 1725627151 21 "lrwxrwxrwx" t 11020655 -1 "unconfined_u:object_r:user_tmp_t:= s0") tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:26.727631 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:26.744351 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:26.763045 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:26.844666 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:26.870794 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:26.887610 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:26.906448 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:26.983946 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.006076 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.010734 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.030175 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.117633 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.139885 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.151833 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.171011 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.252462 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.275070 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.292574 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.311554 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.396961 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.419460 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.431578 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.451191 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.544333 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.567437 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.574681 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.594068 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz= "; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /hom= e/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $? 16:26:27.681818 tramp-wait-for-regexp (6) #=20 t /home/albinus/tmp/zzz tramp_exit_status 0 ///dd77c20acbfe3e98bd0661ddf70b1f4a#$ 16:26:27.701140 tramp-sh-handle-file-truename (10) #=20 backtrace() tramp-sh-handle-file-truename("/ssh:gandalf:~/tmp/zzz") tramp-sh-file-name-handler(file-truename "/ssh:gandalf:~/tmp/zzz") apply(tramp-sh-file-name-handler file-truename "/ssh:gandalf:~/tmp/zzz") tramp-file-name-handler(file-truename "/ssh:gandalf:~/tmp/zzz") file-truename("/ssh:gandalf:~/tmp/zzz") #f(compiled-function (end) #)(4481) font-lock-fontify-keywords-region(4398 4482 nil) font-lock-default-fontify-region(4481 4482 nil) font-lock-fontify-region(4481 4482) #f(compiled-function (fun) #)(font-lock-font= ify-region) jit-lock--run-functions(4481 4482) jit-lock-fontify-now(4481 4482) jit-lock-function(4481) end-of-buffer(nil) funcall-interactively(end-of-buffer nil) command-execute(end-of-buffer) 16:26:27.701222 tramp-sh-handle-file-truename (1) # File error: Apparent cy= cle of symbolic links for /ssh:gandalf:~/tmp/zzz t /home/albinus/tmp/zzz --8<---------------cut here---------------end--------------->8--- 15 times the "test -h" command - I guess, Tramp shall do cyclic link detection better. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 11:07:30 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 15:07:30 +0000 Received: from localhost ([127.0.0.1]:57211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smx29-0001p4-Q7 for submit@debbugs.gnu.org; Sat, 07 Sep 2024 11:07:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smx27-0001oo-9s for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 11:07:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smx20-000691-Tq; Sat, 07 Sep 2024 11:07:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yExCENKow2IJjCqHHfl0tgMu0yZ61Q0rZ6aoTbv8lNM=; b=cXcC4/1mVdj0 75jg8HKponRdnBdwd2T4gCEPcnTJMvj2Xpv414Kai8K8jcuAa5nYLdbADkGauCgbYdKym9Jsv3nR0 m3PneAg830hfR35q6YSwCcg47ig+49TtEQ7Mq0tb5oK9TbnwBpjvANarv4e9/Oo+lYAbz1fe+P4JX RPViacFHTizB3SD7QO7x2rA3MqWlq6YGvPqbP/5WOt8ak3CSBYR81GjZfSTFXjvlP5dst8rGqIkEL b8mQTmSXx8LFhKD539IlgisO6ythPT6jz7sTaI4HXIQ/NuvgR112UiKzMoGbDYg4OexLABqwtYB1W oWO5UjVRWd7NkLTk0Yp21A==; Date: Sat, 07 Sep 2024 18:07:17 +0300 Message-Id: <86a5gjy02i.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87bk0zjzt1.fsf@gmx.de> (message from Michael Albinus on Sat, 07 Sep 2024 16:36:42 +0200) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> <87bk0zjzt1.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Suhail Singh , 73046@debbugs.gnu.org > Date: Sat, 07 Sep 2024 16:36:42 +0200 > > Eli Zaretskii writes: > > > Michael, what do these checks entail, and why are they so > > CPU-expensive and take a lot of time with slow connections? > > I made a test. In a remote directory I have created a cyclic symlink > "zzz", in order to see what Tramp does when running dired on the > directory. The additional actions are > [...] > 15 times the "test -h" command - I guess, Tramp shall do cyclic link > detection better. I agree. But that only explains the time delay, no why Emacs is consuming 100% of CPU, right? Waiting for the network should not consume CPU, unless I'm missing something. Also, Suhail Singh says that there's a significant delay when there are valid symlinks, in which case I don't expect Tramp to issue the same command 15 times, right? I'm sorry to insist on understanding these fine details, but my experience is that without a good understanding of a problem we might devise a solution that is only a partial one. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 13:36:36 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 17:36:36 +0000 Received: from localhost ([127.0.0.1]:57565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smzMS-0001mZ-49 for submit@debbugs.gnu.org; Sat, 07 Sep 2024 13:36:36 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:50192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smzMP-0001mJ-Ax for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 13:36:34 -0400 Received: by mail-yb1-f195.google.com with SMTP id 3f1490d57ef6-e1651f48c31so3457781276.0 for <73046@debbugs.gnu.org>; Sat, 07 Sep 2024 10:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725730526; x=1726335326; 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=XVWSj2TfZoip73krmTZdBAZzN2i9qZCQoqOGf2S6pkA=; b=GS6PlQXJC2PbWVAeDBtZmEtdrOGIuw1BIJtTlLurQSR0+BFXV82MFbFmQn0kuiM47B piVLLEWm2C5ukiQhX00wAqyZzOnlR+690NWZiLWhJr8D1lf+l+ESuiXQgZfsV4rWz+kH t3bW/EFX4ARkTC+Wx3t8a8Q7NtAvu2trsnCahicKjI3kbHZ+pgJAUr5K7ZAsPSI3sRff O2nSbxwJMf6HgRAn4ZXTi09ckI52cNfSb9Ej8zQ5MC6ghFM5EgcQEEM1f0K6osEVyAP3 pU48i5p9KiYar+vkWOkTkQgkVLsMtLWT9wGXQX3m8Smbn7Js0QJe8CL6IVG8w6dmfHdk P34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725730526; x=1726335326; 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=XVWSj2TfZoip73krmTZdBAZzN2i9qZCQoqOGf2S6pkA=; b=Eh35E3EbAbmYqJ/kXzZUu9DkxjN1tl3rWubebe8jOwzQ2szenSwfko2ZKhRjnK0kom QqVqhY5rcRM8hGLcdnLlyAKsjdNFoXTTQjqgL5bbHJodc6nE34jgO8Ol9XDAmu1vGvwR Im8vT26l9wx7KmzAxQHMKiahrKNyU9OkKFtnSOYAqvwpHdjzo9QbY6/IQtxTJKdvqGgV YPrbNrVoiFczhbjSb1CmUMZDgPyJ0fldKwYmp7pdsg0vybDUY6kA2cnMzn8QQQIXVM8N LEX76KnxkAf/0SX4RS8KNESVWBUkszM1fgnWAzv/wIyPppWKxaE+qIgRwzHT1Lo/llzg qhEw== X-Forwarded-Encrypted: i=1; AJvYcCWAl59RTm2k2alnhZslyG2QEuLDvAzrc3jvkDJ5euUGSznz6QADWAr2HTsaVUE80rOYlGFigA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yydk/yaJyjCP+lVEs5ztoyMG2jz6l+UaTR33B1I50cDQyii0Xgb v3RLRe/lEhjlTA5rOfSGPdZVNYuFIrykDmATCCpSbyeHyBlmD/4zElsR1CMB X-Google-Smtp-Source: AGHT+IE13yFZfplqW7LB7OfOpyyww6ALYIsBHEsKwMVbzjPECiHbwBEq90mVY3qwcq4xUPnltqJRUw== X-Received: by 2002:a05:6902:2301:b0:e13:d0af:b1f8 with SMTP id 3f1490d57ef6-e1d346b00a2mr7432815276.0.1725730526179; Sat, 07 Sep 2024 10:35:26 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822f6bb0dsm5678161cf.72.2024.09.07.10.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 10:35:25 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86a5gjy02i.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 18:07:17 +0300") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> Date: Sat, 07 Sep 2024 13:35:14 -0400 Message-ID: <87wmjn2wq5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Michael Albinus , suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: >> 15 times the "test -h" command - I guess, Tramp shall do cyclic link >> detection better. > > I agree. But that only explains the time delay, no why Emacs is > consuming 100% of CPU, right? Waiting for the network should not > consume CPU, unless I'm missing something. > > Also, Suhail Singh says that there's a significant delay when there > are valid symlinks, in which case I don't expect Tramp to issue the > same command 15 times, right? Yes, while there are clearly inefficiencies in cyclic link detection, that's not the situation for the reproducer I shared. Font-locking symlinks (broken, not broken; to files, to directories) trigger the issue even without introducing cyclic references. For what it's worth, as I shared in an earlier exchange, the profiler-report seemed to point the finger to `tramp-wait-for-regexp': | Func in font-lock check | TRAMP handler | |-------------------------+----------------------------------------------------------------------| | `file-truename' | `tramp-sh-handle-file-truename' -> ... -> `tramp-wait-for-regexp' | | `file-exists-p' | `tramp-sh-handle-file-exists-p' -> ... -> `tramp-wait-for-regexp' | | `file-directory-p' | `tramp-sh-handle-file-directory-p' -> ... -> `tramp-wait-for-regexp' | Unless I misinterpreted the profiler output, something in/about `tramp-wait-for-regexp' results in the 100% CPU usage. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 07 13:59:34 2024 Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 17:59:34 +0000 Received: from localhost ([127.0.0.1]:57583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smzif-0002wK-Fp for submit@debbugs.gnu.org; Sat, 07 Sep 2024 13:59:34 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:59768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smzib-0002vy-2T for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 13:59:31 -0400 Received: by mail-qk1-f194.google.com with SMTP id af79cd13be357-7a99de9beb2so87958485a.3 for <73046@debbugs.gnu.org>; Sat, 07 Sep 2024 10:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725731901; x=1726336701; 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=ToxAwKjiE+Qk/tmxjFbr6NheJOWqOdmkCmxFMqSIuwo=; b=Rit2h+yKX9iMt7oDxlysZRpW9cjNUoDyaDCCBtY/n0oE9PNWoNZUBEgZDmmvf0FnGo 6CENdy/TAQ8Vz0CrxjSC/FufkFip6YEFK7D8/fduROYHEEMq2spW4T3i2TxDZloP5+lS bmxhwxRHeWmweLznl1cK6/xCpHrw+6WSSUTYm/s+Iuy3sQX9PduwVgrHvBwxUsPgLoPn cvkhm2h1gNTaw7C6G4hOtk6UH8RRbbqYIA/9cXLqXAIkceGdFI/+V9GwkEqedCwgflvu eldtVBHatPAJuqupzEIpi0n/aMzeOerbmFlZIgvY79RAUR79jC7Dx0SnochoP+No43fg m4mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725731901; x=1726336701; 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=ToxAwKjiE+Qk/tmxjFbr6NheJOWqOdmkCmxFMqSIuwo=; b=SiCWgbifrQnthD6R4xupFifEN00R/F8FWhQBr7gdVQx7CAHEZxu4XQLIT0Sb0dsxVH DlwuRpeJhrrLt3zcWiV4787xrlA/gEG6Y+vpPd7tlebaKFBo6hL6IIkuuvUS9+3p2Fh9 4qYJQRp6YfYmJQrpjW59MJYbe+ig6Mua5N+coXy4Ey1jKeZj48u90u72I5E7SyEDue2I f76XKCgMDOw45nmgWr4RIZ1wFu7Z/oM9/dtf/zZqyzFA7XucsZoXNAJgWE4unhiu4j5o CSYMJcbV3r0ffT6Y3a69GgXots3ON60OeDR2y75+jv6fmigGDBXyZz2AbiuS0VWpze9k yW/Q== X-Forwarded-Encrypted: i=1; AJvYcCVulXFvttB2pQHJTaQl8nIVYoK5H3uWitrckT1OxUnwvZGjZCfcgLUdCqB2uG0Tq3ttbJbxtQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwjGg8X4b1pLppzSDyTUnkMUKTRmJjPsOeAcyJGdbAXQ7WYylM0 QUypOKHTJtn5j67MU21wcPAzG9JEcHXXroSJ2swqdu8WpuUWiDmapSDDOQx7 X-Google-Smtp-Source: AGHT+IGn47epg6o7oDseTUTHdaVspjn0gU+wstTONtJqV9rPYCbCaElkrRd0MDmdWEOd7zmVKsLulg== X-Received: by 2002:a05:6214:3c9d:b0:6bf:7c44:f7b4 with SMTP id 6a1803df08f44-6c5284ffbdamr61742596d6.31.1725731901465; Sat, 07 Sep 2024 10:58:21 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c534786129sm6121756d6.135.2024.09.07.10.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 10:58:20 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87frqbk0fx.fsf@gmx.de> (Michael Albinus's message of "Sat, 07 Sep 2024 16:22:58 +0200") 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> <87frqbk0fx.fsf@gmx.de> Date: Sat, 07 Sep 2024 13:58:10 -0400 Message-ID: <87plpf2vnx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: >>>>> 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. > > I gave it a try, see appended patch. Thank you for sharing the patch. I haven't tested the patch yet, so my comments below are based on reviewing the code and my experience with the workaround I currently have. > There's a new user option `dired-highlight-symlinks'. If non-nil (the > default), symlinks are highlighted the same way as now. With a nil > value, they aren't. I propose that the non-default behaviour be that `dired-symlink-face' is applied to the entirety of the symlink. If you agree, it might be better to additionally rename `dired-highlight-symlinks' accordingly to reflect the updated behaviour. > You can switch this option on and off globally. However, it would be > better to do this host-wise. For this, we have connection-local > variables. The following code snippet in your ".emacs" switches the > option off for the remote host "remotehost". > > (connection-local-set-profile-variables > 'my-dired-profile > '((dired-highlight-symlinks . nil))) > > (connection-local-set-profiles > '(:application tramp :machine "remotehost") > 'my-dired-profile) > > Comments? TIL about connection-local variables. Yes, this would be helpful. However, if so desired, I imagine that setting `dired-highlight-symlinks' buffer-locally in the `dired-mode-hook' would work as well. Is my understanding correct? -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 07:26:21 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 11:26:21 +0000 Received: from localhost ([127.0.0.1]:58067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snG3g-0006jp-Te for submit@debbugs.gnu.org; Sun, 08 Sep 2024 07:26:21 -0400 Received: from mout.gmx.net ([212.227.17.20]:42467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snG3e-0006jX-IB for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 07:26:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725794769; x=1726399569; i=michael.albinus@gmx.de; bh=k4P8Wk3BGDWt83GmbVU2PDFPcdiMpJDbXCv4rYx4GUs=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=UBorDrB6fRo82H0dat3gaZNdf1mR45XXBEQQMpnQd5TBSXzUcQmUXfABlq3nfWkq pSEIJzW+xQkeqyu8FlHsK04R2e/B78+NWPnHrXaWgGTCU3pnIX5SU3E8lh3jxnAR8 Ga2+entiiK3fWFCLgxj0Logj92sqxciVc9q6CTSo1ZaSi/7bC/e5lNQ3vug5tWbHY Q6fRwbU3G2+whGpLN3vUZirC9aqM1y4BlwZpM+0QdT5cN61Zsxsim0DVc0JxkhTho hneyaZ7kZmpHUIloN+wOTf2ozkpqWTsEyLciHW7JgKg1fsJwnTi/zJCa8Vd9+0spq vueqLQBlHTK8tZ2vDw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJmKX-1sTF8K2BHF-00K4gh; Sun, 08 Sep 2024 13:26:09 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87plpf2vnx.fsf@gmail.com> (Suhail Singh's message of "Sat, 07 Sep 2024 13:58:10 -0400") 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> <87frqbk0fx.fsf@gmx.de> <87plpf2vnx.fsf@gmail.com> Date: Sun, 08 Sep 2024 13:26:02 +0200 Message-ID: <87wmjmidyt.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:tgORYPAGOv8RfRZeDBJ3yZOiuo/yHVhs8gtVTRQ4UQUe1nluuIy ZgkMq6L3Q4SdL5F/JmdvOUMgo60FDQrlkwSqtW3hKLr/ZpeQLrEK/YLUBEr1VAWuCS1ZVJy TO8MVEF0R+bM3eIRvegDrDdZUZKnYsuCV0+ACPVuqFQgbqfUtatfuiMUQeF8pHTh0CI4VKJ ZfSyZlHNgdkDuYcG7uDIQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:HIYyTmgTc08=;qDLyIQ5RWdJuT0hPx8vvn4BiKZT eVGApxzcNGBHRWuGx5kMIg/4mIMnInxUmdmwGYBF1AEBQH19sIr4k8AoPe0Pemr0hw7OHa31/ ZVZ/0UFa8EkxElzUqgdYFv7zM88/PKdAFEHGjrwYD5725Wazjq4Cz+zj4cTmZBF9h72NbH/Mn 6DZNqGyTvKH74cgE6Dwt3yJgcoGlpX8f85AErELUUJJXkZAWyxDkqh0Yb7fqvAwfw/GGnuAUp oB91xAP4dpHT3h1pP+OoTpnjyDs5ZD0+KLTGLvS7wsCqUQmeeMKXyPgGbyk1z8703d3gMom4m MTkufQfGbFTTmCXCPYPX2Mbj38iO9sTBMJLqkVnTi3r6FPb2uOQVI/fTEkiGgdKeunR4MN93z dHqEyCU0qmTw1Z52guV6ILqu/I9F3CkMY+ntUlLfyIPWpeWH5ECq2MDDSQZp4dh2GL5QTW0vR y0miZpQksidsGex8ZeEiyM4R/kuVTPzMylmx+X+ISZu9xgljyJ301By33Y9rpObV1dbI8CC+p AoQfIBDx7w9wzIad286wqrjiM7uYdTJG/o/qUaRDz73y+cNnCj+w1EZ4KKSLzilzUjIiO88le Bd2ieGLNCVguF0mlLLn5WVThGwam/md4GoRtk4QopDynLVdNipgr6KemsquojxLlNb6QtTeMC HkZDYNvJwX0Zmo3zA3mNdLZbXO1Rd/5BuaprWAxC83WEtPDyBFTJVfQZ8qiGviWpc/TNN85MA 7mkKeSU9aVZyQjJECw1FjEVh9/A12GZ2hcCAD5ptIu+VSQ2t7DHufqElrorJ4CTeOWj5uYT2c HAMX6+ksTsZGIRt/L/MVHJ0Q== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Suhail Singh writes: Hi Suhail, >> There's a new user option `dired-highlight-symlinks'. If non-nil (the >> default), symlinks are highlighted the same way as now. With a nil >> value, they aren't. > > I propose that the non-default behaviour be that `dired-symlink-face' is > applied to the entirety of the symlink. If you agree, it might be > better to additionally rename `dired-highlight-symlinks' accordingly to > reflect the updated behaviour. Good catch, see reworked patch below. The user option has been renamed to dired-check-symlinks. > TIL about connection-local variables. Yes, this would be helpful. > However, if so desired, I imagine that setting > `dired-highlight-symlinks' buffer-locally in the `dired-mode-hook' would > work as well. Is my understanding correct? Yes, connection-local variables are implemented as buffer-local variables. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/dired.el b/lisp/dired.el index 0d526dfc376..bc984c3506d 100644 =2D-- a/lisp/dired.el +++ b/lisp/dired.el @@ -738,6 +738,13 @@ dired-ignored-face =0C ;;; Font-lock +(defcustom dired-check-symlinks t + "Whether symlinks are checked for validity. +Set it to nil for remote directories, which suffer from a slow connection= ." + :type 'boolean + :group 'dired + :version "31.1") + (defvar dired-font-lock-keywords (list ;; @@ -815,11 +822,13 @@ dired-font-lock-keywords ;; Broken Symbolic link. (list dired-re-sym (list (lambda (end) - (let* ((file (dired-file-name-at-point)) - (truename (ignore-errors (file-truename file)))) - ;; either not existent target or circular link - (and (not (and truename (file-exists-p truename))) - (search-forward-regexp "\\(.+\\) \\(->\\) ?\\(.+\= \)" end t)))) + (when (connection-local-value dired-check-symlinks) + (let* ((file (dired-file-name-at-point)) + (truename (ignore-errors (file-truename file)))= ) + ;; either not existent target or circular link + (and (not (and truename (file-exists-p truename))) + (search-forward-regexp + "\\(.+\\) \\(->\\) ?\\(.+\\)" end t))))) '(dired-move-to-filename) nil '(1 'dired-broken-symlink) @@ -829,10 +838,12 @@ dired-font-lock-keywords ;; Symbolic link to a directory. (list dired-re-sym (list (lambda (end) - (when-let* ((file (dired-file-name-at-point)) - (truename (ignore-errors (file-truename file= )))) - (and (file-directory-p truename) - (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" end t)))) + (when (connection-local-value dired-check-symlinks) + (when-let* ((file (dired-file-name-at-point)) + (truename (ignore-errors (file-truename fi= le)))) + (and (file-directory-p truename) + (search-forward-regexp + "\\(.+-> ?\\)\\(.+\\)" end t))))) '(dired-move-to-filename) nil '(1 dired-symlink-face) @@ -841,12 +852,15 @@ dired-font-lock-keywords ;; Symbolic link to a non-directory. (list dired-re-sym (list (lambda (end) - (when-let ((file (dired-file-name-at-point))) - (let ((truename (ignore-errors (file-truename file)))) - (and (or (not truename) - (not (file-directory-p truename))) - (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" - end t))))) + (if (not (connection-local-value dired-check-symlinks)) + (search-forward-regexp + "\\(.+-> ?\\)\\(.+\\)" end t) + (when-let ((file (dired-file-name-at-point))) + (let ((truename (ignore-errors (file-truename file))= )) + (and (or (not truename) + (not (file-directory-p truename))) + (search-forward-regexp + "\\(.+-> ?\\)\\(.+\\)" end t)))))) '(dired-move-to-filename) nil '(1 dired-symlink-face) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 07:30:17 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 11:30:17 +0000 Received: from localhost ([127.0.0.1]:58072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snG7U-0006zp-Pb for submit@debbugs.gnu.org; Sun, 08 Sep 2024 07:30:17 -0400 Received: from mout.gmx.net ([212.227.17.20]:34449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snG7S-0006tc-62 for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 07:30:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725795006; x=1726399806; i=michael.albinus@gmx.de; bh=siGexmfjftrvy4QQKFVyaFE0aEIlg4IZJUbELATXKls=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=i7p6lwuFipi+80JmFCGRRdvGhhAoxj3x7Cr0kvspPZbgzUmXdPbrLzcnahFUqDyk a3E03Hw0lOl6L02S1nzZmteBOgviWoaFlShpw/1riJKY6367YLirZOXyNbIcjYXYe kVkUoEraq+//rUbq28CXMRk5o2/WnSQTpiOBQ8SnU4lnJSAJIkn0kslIP2q+j/odD 254e+U4RD+7PyPppuT10DtTptNAhHW5fUUvwLoiZUS9pNOechYCFcS4LQyFr44r0A zjIPBy047JuRDV2Bv+IGz6m3IlBLtLg5G19+IXXnoSjo458YPOnziB/zwJvw2/T/5 WA5x6ytEy2J/K/6sew== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6UZl-1sgOUG3d6X-00EUxj; Sun, 08 Sep 2024 13:30:06 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87wmjn2wq5.fsf@gmail.com> (Suhail Singh's message of "Sat, 07 Sep 2024 13:35:14 -0400") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> Date: Sun, 08 Sep 2024 13:30:00 +0200 Message-ID: <87seuaids7.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:/QiqySbq7kbHcxOHeM310uFHcQGwXvm8dka1hML0KuYZDzx7ReT A3Ya/0caUE0Aa/tEYtQgdzlAYekbivR/MPkMeLl43q556BpDsQgYnL2X6uBDpeIlOg4gwAA YWpPlPa816LLhL3oRZsx6Rs+InaxcLSNYuXL9ua22H23WMMhGZVv6T3SBqkZHOyCTCo+DSr tuQ8urNls9pLYHEo12M6g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:7/5D9f/FKI4=;k6gRW6M3itUVVzEnkpC03l+ZcuP oXyeL1/Hy3coZnuiAEILfXWi37YCVtSyYazuf91w4w+OojSAT73YuEwOLD5zX9omHfZErZvdr ONQ1RXr6A8BQKPfriK0kiKvR7lnwxXUFQ3GcwnlSfeU2QSY44iAfdJAdG7Q1wtkSByB+OU7tA Tezw0XaMO7E+3pkGlyVaahgylJpXeeP8HbhfRYS7AVkNvvGjZPM76Iq1k2tWIF5Vkje69anTt BTu1z6Ja7RO/LhTJASqSzV/du2SDMvAByp3drkD1+SLHCUbZfWmXLtH+89JietMdc0cAquaUY 8Qca66NOANIN50PAHdN2N6Nmxy8xQtAiiHXwBtWouVfHi1icHZ9qRs5NY+SntZu+amW5MO6dr UMY8R4EzmEQs802KSYpuhmj4D1TlHgMprGpvwaBXpTQkS6l0zEYsBJK0Hty+P3RAldX28MdWX sten7IqtfXuyw7euS7pXq/xbHTpMvQSQp7yyN+jOlU6KJ/kvDtuUwXE4CD+aXQcbhJ9+01Bh9 zibwnnKDyGZ6w7qtBwuk6tmiAh+9RBRyQk96zxa875ltJjtQgwBdB1LyP09mw02/9B4swDSD1 gFdd/NSDSL2Kd2tXXr3+7NUQ2bCtgVzcJbJCG7mqiRkEX1HdUv0JkCz46H2DQa9O1qPEtI/ix ues2Le6XAOtfTVmjSkL/vKEvrSUvBKgTNcZL+wxRGAtNZOr70Oarneiv1HN7R159xA0uErLcD c4d8hw2yPR9Y8TywpdN1NVoVDTncR2hqnsVIQ8DZ7K+wDg56JlA8L6anAY3o17dzRrY1w3SF9 nkNUUNq2bPXJwZAfFoLiVoQA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi, >> I agree. But that only explains the time delay, no why Emacs is >> consuming 100% of CPU, right? Waiting for the network should not >> consume CPU, unless I'm missing something. >> >> Also, Suhail Singh says that there's a significant delay when there >> are valid symlinks, in which case I don't expect Tramp to issue the >> same command 15 times, right? > > Yes, while there are clearly inefficiencies in cyclic link detection, > that's not the situation for the reproducer I shared. Font-locking > symlinks (broken, not broken; to files, to directories) trigger the > issue even without introducing cyclic references. For what it's worth, > as I shared in an earlier exchange, the profiler-report seemed to point > the finger to `tramp-wait-for-regexp': > > | Func in font-lock check | TRAMP handler | > |-------------------------+----------------------------------------------------------------------| > | `file-truename' | `tramp-sh-handle-file-truename' -> ... -> `tramp-wait-for-regexp' | > | `file-exists-p' | `tramp-sh-handle-file-exists-p' -> ... -> `tramp-wait-for-regexp' | > | `file-directory-p' | `tramp-sh-handle-file-directory-p' -> ... -> `tramp-wait-for-regexp' | > > Unless I misinterpreted the profiler output, something in/about > `tramp-wait-for-regexp' results in the 100% CPU usage. Tramp is in a loop, waiting for results from the remote side. I don't know how to implement this differently. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 07:47:22 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 11:47:23 +0000 Received: from localhost ([127.0.0.1]:58090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snGO2-0007oa-I8 for submit@debbugs.gnu.org; Sun, 08 Sep 2024 07:47:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snGNz-0007oL-TJ for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 07:47:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snGNs-0008Nh-4D; Sun, 08 Sep 2024 07:47:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qslZZgI5elmHyVR4E+rU/+YS58WGxfckouUTFJsCnFs=; b=ZG46nTpHYjMe fx+r0KU/jubdFqNfhMu9sKZiVSmjfdBtoYtsIsEkRnJ35myUWLeGR4GLT2zT8SX3dt2WoEHbthVaH lQUSG6GTJNna5ZDLCxhoEtnlzgaWjEjrtkWZOvQiGS4U7fI0i4Al53NcxYtkIB/K23JKz0ZbPlimX vxN7glS7BZjSwU/O7A9olOJrcHSehNdRTM4ZZHp+GW6tLZhe1CakzUS7n3gqodQA6rAXCBnt9q5hH hz2ynK2SI87tZi44E+c0NAz+s44/YScHyJpzBMd/goRHrDzY+VmC54iOQElaexZgMS9nclGf4IPHd aOS/CDWzUTiqOMMyQJaAUg==; Date: Sun, 08 Sep 2024 14:47:09 +0300 Message-Id: <86frqaweo2.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87seuaids7.fsf@gmx.de> (message from Michael Albinus on Sun, 08 Sep 2024 13:30:00 +0200) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Eli Zaretskii , 73046@debbugs.gnu.org > Date: Sun, 08 Sep 2024 13:30:00 +0200 > > Suhail Singh writes: > > > Unless I misinterpreted the profiler output, something in/about > > `tramp-wait-for-regexp' results in the 100% CPU usage. > > Tramp is in a loop, waiting for results from the remote side. I don't > know how to implement this differently. What kind of loop? Can you point me to the code which loops there? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 11:11:00 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 15:11:00 +0000 Received: from localhost ([127.0.0.1]:59887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJZ6-000225-GH for submit@debbugs.gnu.org; Sun, 08 Sep 2024 11:11:00 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:50191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJZ4-00021t-IE for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 11:10:59 -0400 Received: by mail-qv1-f66.google.com with SMTP id 6a1803df08f44-6c34fb4f65eso18231806d6.0 for <73046@debbugs.gnu.org>; Sun, 08 Sep 2024 08:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725808190; x=1726412990; 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=+6eIjMslT1n+RyeHmdu3yUn/06nZyrX8XdZhQ3VI3bc=; b=ZT7WymsWEkBdtNyloE82XkFSBRy8+TK/jxe1UuFNXKfNAovEDmG62YStrIqAI+mIG3 Wlj7+ycdW9joYHNqI3J9Xza+qOJMfAvBtwZR3UWx8iloEIb2YKM4bhsjCtJ48jblAq9p 5sjdedgHQYty89JtUpq6deLO1Y5/lK1B3ruhI3IhWT6Y7frxzHOW/8L1ZuDHLUQBwKCD k/3VbmG1c3yYGxZU9pTHMdYhIXdY2u2gySQIqwR4JNYZApJuNeiV5R2tDqQbuoqr8eEJ MuVLdM5fLwvsWe7ZA503cJDin0/J1FoT4IUKOLzEGapQOgQ7kKszTbwXvDyWrJzH0gFu pVAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725808190; x=1726412990; 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=+6eIjMslT1n+RyeHmdu3yUn/06nZyrX8XdZhQ3VI3bc=; b=gA6gOAC0pzsIwFmg92cVs7C0KH2n/Mcrl6/VGduyAi6YRA8QNnS+AA6UMYTH+uPp1+ OeveQL0zxN6OX1pyyzpIbne4XgB9nh3u/JiBiUTmrJTCzNH4/pNfKMZpdGgyMIlaP/Am UodyO5JE7TcUJ+2Ya29Pe4jEVcC5WBH3HrXBDpDYhVV3BU4K1APsjhKA2Fbaz+68BhTZ sLhWSpKcNe28ZidxCv9YfqUwSejwswt2EoFvoyVMpB7I9yY/W16nh7HnE75UQ7JDsiVg XoGFl0MXw/7wJZE49p6pds+ZgGMu90G5EIoWIJs0Njq2oUT46RBvf79nmf2be5Ni2XT8 YLbw== X-Forwarded-Encrypted: i=1; AJvYcCUOFnD/PdvZVl47x6bVe+I5pQS9i5VipPGr0EvDPjjiugZ1sCNqvOOgkNs6bjjLbbaQLa0KWQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxCBT2++k2NGOB/ewekc5z/Iw8fiCkmroJ3fbpsAlpgVyoYRjwM S6xLapuJu6Tkw4Njhhuga6iXDkxz10nojAAPAcl3Ooh0wX0OZFgNO/kvKpim X-Google-Smtp-Source: AGHT+IEfCZn6tPXhxgVuM9mq3vv9cmQSIb3A/8YDTeeHcmqHbhA4/R4OF788e5bgZDht2W5zGXVF8A== X-Received: by 2002:a05:6214:33c2:b0:6c3:5a89:9998 with SMTP id 6a1803df08f44-6c5283fb8d0mr106751326d6.23.1725808189786; Sun, 08 Sep 2024 08:09:49 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5347860d7sm13187716d6.136.2024.09.08.08.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 08:09:49 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87wmjmidyt.fsf@gmx.de> (Michael Albinus's message of "Sun, 08 Sep 2024 13:26:02 +0200") 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> <87frqbk0fx.fsf@gmx.de> <87plpf2vnx.fsf@gmail.com> <87wmjmidyt.fsf@gmx.de> Date: Sun, 08 Sep 2024 11:09:38 -0400 Message-ID: <87mskii3m5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: > ;; Symbolic link to a non-directory. > (list dired-re-sym > (list (lambda (end) > - (when-let ((file (dired-file-name-at-point))) > - (let ((truename (ignore-errors (file-truename file)))) > - (and (or (not truename) > - (not (file-directory-p truename))) > - (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" > - end t))))) > + (if (not (connection-local-value dired-check-symlinks)) > + (search-forward-regexp > + "\\(.+-> ?\\)\\(.+\\)" end t) > + (when-let ((file (dired-file-name-at-point))) > + (let ((truename (ignore-errors (file-truename file)))) > + (and (or (not truename) > + (not (file-directory-p truename))) > + (search-forward-regexp > + "\\(.+-> ?\\)\\(.+\\)" end t)))))) Minor nitpick: given the comment for this section (which seems to suggest this only applies to symlinks to non-directories), wouldn't it be "better" to simply have something like below instead for the if-then case? I.e., a separate entry in dired-font-lock-keywords for the failsafe. #+begin_src emacs-lisp ;; Generic face for symbolic links (list dired-re-sym (when (not (connection-local-value dired-check-symlinks)) '(".+" (dired-move-to-filename) nil (0 dired-symlink-face)))) #+end_src This is essentially what I have in my config today, and seems to behave as expected. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 11:20:14 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 15:20:15 +0000 Received: from localhost ([127.0.0.1]:59891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJi2-0002Yn-Jg for submit@debbugs.gnu.org; Sun, 08 Sep 2024 11:20:14 -0400 Received: from mout.gmx.net ([212.227.15.19]:41019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJi0-0002Si-FG for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 11:20:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725808803; x=1726413603; i=michael.albinus@gmx.de; bh=bNLGlkLCNlcro06zFb9uOWhk9gb3HVAxcSdXudtXGoc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=VPr9/2EArSBfTdRI1RfHVTghVlBQj0/k2V5yIlaG/2/3QkdBsUtkhK9sy+rlmAkk ZI75bFu7jWAddnhUznXd/sJLEYY97IYlGjmgTNn7Z6dzLwBzkiPN1T5z3e40kKS+0 RuyJjjOc4EDAU+XKzG/7XB/cLCpGbyQFNr66lhSCPHmSMG9kfvvPbshagQ2a6wbE8 PyiX6hZz4suWy9xszMS9HrXUfuJ5KCVFNt7RITwrYKgSkL/Ys+QRaR7pOUVgvynv+ Tii3ohx5QCK8/lSQWcm+itPYa2bJF1/V10ANXCy1NZFpbZ2+wYuRLtIz0EmRVWkV8 5J5EZcU6vlW6304Ybw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MN5eR-1sUHQ60yYP-00ThII; Sun, 08 Sep 2024 17:20:03 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87mskii3m5.fsf@gmail.com> (Suhail Singh's message of "Sun, 08 Sep 2024 11:09:38 -0400") 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> <87frqbk0fx.fsf@gmx.de> <87plpf2vnx.fsf@gmail.com> <87wmjmidyt.fsf@gmx.de> <87mskii3m5.fsf@gmail.com> Date: Sun, 08 Sep 2024 17:19:59 +0200 Message-ID: <87ed5ugokg.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:TvtlFa1X5+hRd3ImQSD1KTw2pqBaXiXLZ5jgm5zq7fb549Sf1uz y1be/M/eK5susUkiRZ4TbgBroJH1wYJMJlbbwN/uQXK30gQxil1PdurUc3haN+Z09qPVh9s Xcj9LReRMyP825UF1IZK/THy4Y4NKHpHAyAQ6ZFT0XVh8zyEjoAFiswQ6Z6iJzG+LtpF01R 6xSIwH2gUPoSS3XTLOVYg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:kyg0Wtt3k1A=;UTS3ByDo3GJlFoiQk8CQH0f/11S gWGiOrpr4I43iCyiZSB0t9x63qgF5C7QeyGvQwnOBpV6DYa3AXrUYtM8+Xu2hWjhM8gTfc4v0 PRXnApflILpUXDxYXzs7O3qkWGKiYfq8LOI+2BsOR1PSybbJ3ILO19wE/AdzIfCVNKRzGzWLP xSnE1C3iRbXdK34ny3XW55Wn+4OUYmdCYD1C4IEXw27uBv6fdjb5qq6W4YB3GdgkIHC9by5u9 CvLkEw3puN4v4gr/vxOm38+chBzea51PFMVmSwHgfWoi1nXoO2ONNxlsg9yK3QSbSaGTg4YI1 eHrHoIh9uYZ0lxFKKLpAf0fqv8FRRPUQih3upS/JbzolIQ2Wfljymah4gL25a2r0biSKesdB0 6lscUd1Pc7UUiVbM23R3cHK4JRcvdbSbmzYOoNRgESAx795Q+Ec6fiUOLCYNWVr7ssJEn2N9Q gJhg7NNtnkdwgwBPkfkA6zormOzF+cQdGWN1LFCAB+nbgXtIGPCLNJKfEBMqZXkQeGyZbhBN6 OYfz1gWMg0OUay+8jhnqBWd4Qf1HC6QQKJzB7sbibT6/zxleixVmMqv371LBxTHsoqmE/TO2H A2W6oIcdApOAgWJ0v2WGeZX8NN3ajh2PM0v8LCcmBb2W6tMab2OKKCg9yzTpgKHEe4YhSKcaq sAbs+X9GkdnuN6QVHFKIozWQ+/A5WSW3K2uaqVHL5J4WCiH2hR/+50ux+6SxTY9Cs5qVYNm8W tn8JaPJ83e4AWwyutE36sqddrAkjDGPzAsZXQx6HWroJ/VeyaW3HywzTTiMQtNMgCqtUFZe1k L7hU7jSA5h255LsvzOch7UOw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi Suhail, >> ;; Symbolic link to a non-directory. >> (list dired-re-sym >> (list (lambda (end) >> - (when-let ((file (dired-file-name-at-point))) >> - (let ((truename (ignore-errors (file-truename file)))) >> - (and (or (not truename) >> - (not (file-directory-p truename))) >> - (search-forward-regexp "\\(.+-> ?\\)\\(.+\\)" >> - end t))))) >> + (if (not (connection-local-value dired-check-symlinks)) >> + (search-forward-regexp >> + "\\(.+-> ?\\)\\(.+\\)" end t) >> + (when-let ((file (dired-file-name-at-point))) >> + (let ((truename (ignore-errors (file-truename file)))) >> + (and (or (not truename) >> + (not (file-directory-p truename))) >> + (search-forward-regexp >> + "\\(.+-> ?\\)\\(.+\\)" end t)))))) > > Minor nitpick: given the comment for this section (which seems to > suggest this only applies to symlinks to non-directories), wouldn't it > be "better" to simply have something like below instead for the if-then > case? I.e., a separate entry in dired-font-lock-keywords for the > failsafe. > > #+begin_src emacs-lisp > ;; Generic face for symbolic links > (list dired-re-sym > (when (not (connection-local-value dired-check-symlinks)) > '(".+" (dired-move-to-filename) nil (0 dired-symlink-face)))) > #+end_src > > This is essentially what I have in my config today, and seems to behave > as expected. Possible, but I don't see that one version is "better" or "worse" than the other. So I don't see a need to change it. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 11:26:57 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 15:26:57 +0000 Received: from localhost ([127.0.0.1]:59900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJoW-0002r4-W6 for submit@debbugs.gnu.org; Sun, 08 Sep 2024 11:26:57 -0400 Received: from mout.gmx.net ([212.227.17.20]:47447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJoV-0002qr-4w for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 11:26:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725809204; x=1726414004; i=michael.albinus@gmx.de; bh=7wqqpRc+8X2KzEgPToe1v8OlE1LibNZcQtOilu3WLL0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=rfPt9W5+AtGeveiPuGJbo625XWWexfdZDOqGgqdUq3bGZ87J4LejEuDPe+h1SkNZ rxOzXxhsbejJR09A2Wfrpf9hF+5fHZRoH4F1kaNt86wU9SiJCoblruP5rOHl/gUTn WePbySlKJC5kz+4ZYqjr/oS6k0tJ+qwGZ5EL6HCCeKjveJ9OMxr8bCbe3z3890CMU +/54XNC+IMPQDfr3vTvIa4d/sF5r2NEciwRsZRPfTshJfPZYPD1y+lxlnIcXjvkzA ChcTQ0yCqG7YRu73/QkNc2QZw14TAsT6Mc0akgKxcuKHNVYqSXsYyDPj+3RpMeZhZ hKuOKMEOldTOI4Uxtg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M2O6Y-1skZzR3k5u-009o0f; Sun, 08 Sep 2024 17:26:44 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86frqaweo2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Sep 2024 14:47:09 +0300") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> Date: Sun, 08 Sep 2024 17:26:40 +0200 Message-ID: <87a5gigo9b.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:19U4aRjQTOY66ArNTVw3mCMnOAP8OaGCXo8dBpP4M1NQGWcT9/+ jYMlhyWhvZo2x5jCNeBcIRhqPEjwk0eEeddr4jIAXp9/Qr8SMnMQPU7lp5MctV7Ndbl+RZ7 hHvsqhr503esHLZidDz0vIXiH83OpWwokRGS1OK36ZCUgKmczcsxFY6yEt7tihVWZpbtgrO smGfeftiZzpR4wbKIdFiw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ITLkT2Fdva0=;Gt56g3DsGZ+VmGZ9baGPmuJtvke yAKW9+A9O/e10ZgvYaRv1OHw5tgtkeqtoRxZSKmTd4+AbpwU4733SfCg8jY2w6AeD1u6HkC1d nBfyGpArpAJ4vhwhu9BCCwt4ybMEsZ5ZtD+i8MbO+rq2Vu72hXW6e1Uzdr+5iHip6UefgdTMQ t9ToDxDmnj/VvtDTBy9+calgRd7Doq+VKJwU4iPmF2FbB/lDi4eo1Fpwj/Xc6EZEXO8r1+o0z IHvUGsl2orhrrt91R6d50exocm3ZhAPL0TTYdSNHdQi5aLYy/O4ltdaGWoMthZA3okynFAGfP jDAZ/YIjQ6qjDGhBRHe+cUGnfMWiIm3xxF17D9nJ6dZ0tyXueMSTi4bpHGVWmamyuCE66+xDQ 2L2zm5KBRMGw3G1zUL+aRz34tt72sOBCwap0OmKVTGLgfspkXofpxNaRUns/0wmqXVdiqYxdE pNQyQLruV1B/Cf1VggxRndadbHlUnU5XWL1mteRpwhWkJyAer19BKnYyemknMgxczGy60lpyk cyA3nVepS1fHM+bOpOa2vopj+0l5q5nC8wPyXVBGpBrYYIOGjvoFVppgiTa5LYSDCH7QVuE/g P97ax4iOBG/uoYa+94qhwFERbOBAHH7S/DImZ4SJaAJ+ul0ZtifTOVxfkWPouCU4WPYSXoMvp CV4RbhmFwcMLN08ohwWUw1j5Vn86iA6jry62RW1Jwns/yOUpIsPIMThOUtFd8rxqN8bp5KBtn 3e88emeJEUdu3sAJDHhg5B+b6t+ArrVSh4Kdh7mq11P1NgYNOepYpzeiaDuEBLR5a4Es+MQMY HJRc8RWszYc9hlyR2+vTiMKQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, >> Tramp is in a loop, waiting for results from the remote side. I don't >> know how to implement this differently. > > What kind of loop? Can you point me to the code which loops there? The umbrella function is tramp-send-command. It sends the command to remote via tramp-send-string, and waits then for a proper shell prompt via tramp-wait-for-output. The latter function calls tramp-wait-for-regexp, which loops using tramp-accept-process-output. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 11:35:40 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 15:35:40 +0000 Received: from localhost ([127.0.0.1]:59910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJwy-0003LM-CW for submit@debbugs.gnu.org; Sun, 08 Sep 2024 11:35:40 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:54729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snJww-0003L7-DJ for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 11:35:39 -0400 Received: by mail-qv1-f66.google.com with SMTP id 6a1803df08f44-6c53bc6f9faso4455346d6.1 for <73046@debbugs.gnu.org>; Sun, 08 Sep 2024 08:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725809670; x=1726414470; 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=8yVzEZynGcXm4w+ruNeMya7w/frfDcNKyWcqdDxLM00=; b=D4edcu3qIBpOsF6QJVaFSseH6P/OZTg9JP9m0DZkh8tYRsTWp56xQcqrGP9n6/0g0l Ie0ee3hkowpZZP3bUQNMuCiiQS2I/XSfwl5rnt9cDaDrgeu7n1yevJCDCUnFDCa9FScF RbgdCf8cU2YitonM4d1/tmizvkEYYkMfV/mp1RE6VUssHcabDi/BUwDOmF7QGTxhdKAO /B/2er7rU/eDVk+Zz1jpR9ulSDYe4zQ5lTz/Fx8Er4c+x9wcimP9MM4WM8l7U4VmJAGQ /qY+XxEUz8X1eHmA2BURAU/2K62z/RdJ+8+Rs2PEikbyu4QWO2t+8LuVu17GKYQOWIXJ bPFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725809670; x=1726414470; 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=8yVzEZynGcXm4w+ruNeMya7w/frfDcNKyWcqdDxLM00=; b=qRYb5glZB7H0SNpEqTYUQJ/e785lRqQi1HT2pPII3yAzyJ24VtNKNurQYmBMc41DVi 5siBN3pZKggkYCu5lAWfOQIdQm7ZZqvZUVLoByQbM0t4YDSLxBHs3svisqvXWlYiJO8T jn+NFIM0P4jAvaSp7scYq+wmZXO/NK71OkQ8Oe5cIxOIsmZKqEzwUhbTXaR9zaIPTJAE tFtyKEo76McNFispGrR3jgVjBAV3oU3vx6G6V8+hT98XKDLdOl8gNX0OQI5+4EGFuhJ5 iMTy4hWaSfxgfbPqjOyCaCPEowKx6OZfdPIj8KXNIgHLcowZutS/c9mjEHyXnagyQBOu uomw== X-Forwarded-Encrypted: i=1; AJvYcCULu1YJKNnBO3tv58tRenlRHcZ1+yr/oGIDXqslEImZgYhzsCCX6NL+i6/TVan55P62S3inxg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyYIDlzWk+UfWu2BiC50leKQHSkVVypkyAjYEiYqPHHzNdXHLyR 3eAZGw0jQNaWTNlhmLmyPlEiuDb7iv+ZkY0/5y7GQpyWAf5/wWJ4lSLV04iN X-Google-Smtp-Source: AGHT+IFT9iGouv8QvtOyC1kA29JvdGq77SUyql/sHmqZQND0gxhwRzOUfv1zIqD1YJMyuVXOijaIAA== X-Received: by 2002:a05:6214:460b:b0:6c1:6a94:52d2 with SMTP id 6a1803df08f44-6c5282fdf96mr116332546d6.13.1725809669817; Sun, 08 Sep 2024 08:34:29 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5347749b7sm13385116d6.125.2024.09.08.08.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 08:34:29 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87ed5ugokg.fsf@gmx.de> (Michael Albinus's message of "Sun, 08 Sep 2024 17:19:59 +0200") 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> <87frqbk0fx.fsf@gmx.de> <87plpf2vnx.fsf@gmail.com> <87wmjmidyt.fsf@gmx.de> <87mskii3m5.fsf@gmail.com> <87ed5ugokg.fsf@gmx.de> Date: Sun, 08 Sep 2024 11:34:18 -0400 Message-ID: <87frqai2h1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: >>> ;; Symbolic link to a non-directory. >>> ... >>> + "\\(.+-> ?\\)\\(.+\\)" end t)))))) >> >> Minor nitpick: given the comment for this section (which seems to >> suggest this only applies to symlinks to non-directories), wouldn't it >> be "better" to simply have something like below instead for the if-then >> case? I.e., a separate entry in dired-font-lock-keywords for the >> failsafe. >> >> #+begin_src emacs-lisp >> ;; Generic face for symbolic links >> (list dired-re-sym >> (when (not (connection-local-value dired-check-symlinks)) >> '(".+" (dired-move-to-filename) nil (0 dired-symlink-face)))) >> #+end_src >> >> This is essentially what I have in my config today, and seems to behave >> as expected. > > Possible, but I don't see that one version is "better" or "worse" than > the other. Understood. > So I don't see a need to change it. The comment ";; Symbolic link to a non-directory." should probably be updated in that case, right? Apologies for the noise, in case I have misunderstood the patch. I should be able to test out the patch later this coming week. In case that would be helpful, please let me know. Thank you for adding this. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 11:41:34 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 15:41:34 +0000 Received: from localhost ([127.0.0.1]:59916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snK2g-0003bq-7L for submit@debbugs.gnu.org; Sun, 08 Sep 2024 11:41:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snK2d-0003bd-Kq for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 11:41:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snK2V-00056T-Ds; Sun, 08 Sep 2024 11:41:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AsJr0kdH1T5b4Bacq+Pockv0uLi5zYLomHsPCZ9Re6s=; b=S2XYpimWdmYq 5wsBMe7UQyCqnQZw98KFu7SdAQW4KbifALpGwwqLHON5jRvY6I+MZToFsGrscRtxBvU/0CGCdf3Z0 LD0ZmYeqojqE7/iOC2tWripyHcYz/s3/JiWPpBGi2sQcaz4aNateTIKmIKheSMVqIqBbaMH+d8rh3 Bg4LBg6QcC7GYpIjmnZ79mo9h2Npm+jq/qujnNsn0FTzfl25I/VM3VPKJEJhImaWUHHqSvvbZi+tf p7yJX407jY7Jgjfr5noc0wEUZo8JIs+rlvtAXrP7eW8hLYe7SDNpL3KdYEeqIC09l3YOgJ+SQiuYK Xnvwx5NZY30qrXK2osTx1A==; Date: Sun, 08 Sep 2024 18:41:20 +0300 Message-Id: <86cylew3tr.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87a5gigo9b.fsf@gmx.de> (message from Michael Albinus on Sun, 08 Sep 2024 17:26:40 +0200) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org > Date: Sun, 08 Sep 2024 17:26:40 +0200 > > Eli Zaretskii writes: > > >> Tramp is in a loop, waiting for results from the remote side. I don't > >> know how to implement this differently. > > > > What kind of loop? Can you point me to the code which loops there? > > The umbrella function is tramp-send-command. It sends the command to > remote via tramp-send-string, and waits then for a proper shell prompt > via tramp-wait-for-output. The latter function calls > tramp-wait-for-regexp, which loops using tramp-accept-process-output. Did you try either calling accept-process-output with a non-zero timeout of, say, 5 msec, or inserting a (sit-for 0.005) into the loop which calls tramp-accept-process-output? Waiting for a process to respond should try not to spin without sleeping for a few milliseconds between polling attempts. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 12:35:26 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 16:35:26 +0000 Received: from localhost ([127.0.0.1]:59935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snKso-0006Pd-0W for submit@debbugs.gnu.org; Sun, 08 Sep 2024 12:35:26 -0400 Received: from mout.gmx.net ([212.227.17.21]:56131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snKsk-0006PM-Un for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 12:35:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725813311; x=1726418111; i=michael.albinus@gmx.de; bh=ZtvbIE9NPv7w+Ex8vRy4XK31Ksf/EMl1D8/Gg92mfvo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=c4DU3ThLXnhsJfnKy4onTFjcYAWx2fSunD/KPyTw1I4VxqH8NEzYmKkOkFKqvcPz xiPrCOkEqDe+vt81wrhtmhjN0Chh+HlQ50LHnUAgllM6ulYV1pPkM4ZcU6uCm3zdF RXb3zTEFUaYd1yQVLTW/oA+KZ1/WgU1VOpPBJ3wbmchanhPTaYvW5zgHUUOxtIQfT ZdVFOP2G6P9RqomKk/rJhmjC2pl88GeKGGHMD4D0gxxb2nvdkdVObURcH8TuDkWCU lSH8WNN6Lpy0d7A/FOcUgdHgXhzZ91BFIRnaHZ3FzehkhudcSLaqVX0kuld89SwZn b27LbBJih5VBm9OM0w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MDhhX-1svLcP3QWN-002tIV; Sun, 08 Sep 2024 18:35:10 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87frqai2h1.fsf@gmail.com> (Suhail Singh's message of "Sun, 08 Sep 2024 11:34:18 -0400") 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> <87frqbk0fx.fsf@gmx.de> <87plpf2vnx.fsf@gmail.com> <87wmjmidyt.fsf@gmx.de> <87mskii3m5.fsf@gmail.com> <87ed5ugokg.fsf@gmx.de> <87frqai2h1.fsf@gmail.com> Date: Sun, 08 Sep 2024 18:35:06 +0200 Message-ID: <874j6qgl39.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:rQmn9HzSXmIb0lT+kpB/95XhHUO+yCLJOH8J7ORicQ0mWD9/Owh NRJPnpQQLRrKqGtgUXwQqqr50Pjo27mfOSBO0AC79JxijyY8eOm1u7DqNdF0qw9ykuYsCMK ulBCGKU2SCxlaQcA7dy2C0iBWy+gWEqnahd2Rg5dhWre/BEUMViQkmtl9R/6trHcwCyBJ7X Xn7cMMnq7NQalNy7UiF0Q== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:6a1+itxOHeA=;tNJQZy0WldvvAxN4PJH2F2/KRcZ vIuHl9IGa3EAnQKWLPOb3GFEmmKc55GBLexzVuoSq4d2NRyhhD3myoSy8kQljs9Y1UqZFJEL/ NXBXuRq5t7B2W73wfjWlyvXM89wxu8AYkkW2FN22OnlRJDG3aLquN84SgjJ77JVKC5a6ppSiC 5UvdAyCPGu5uPFrDvT+lj1qC3NYIm3h4Wj+N6obfaEw8pPRgwJPXbL/YGk9LA6M2Kf1qn1RJy 2QAqBdcrA48mI0OzZT1BMp/53mb1uyTDnMYLZZ/DgqSl/5/TxrxsN/NcyVtKTqtaxL7KJYiK0 gvOmPAvR6FPqVmf5fzoALsLHaU8hLH5cQOez5HhCD3rb3paoWc3uNBpncxxcaasMxT8fwHm+9 Gr/fuyRY2y38lHc2lU3IijyuKtCXpqG59LNn2jfdIQ+szCqHUFzyf41SEHzp0hkv/cK+mTdSv JGiPWbTtW06srnG4vzUf3KencHb5Ym+mKoZ+VmentLunDc1izk7tti+Duen19gGQFByxkeSne MmJGIoiNDRxxC9cwKpVeAZgYj4h7a51Jl585X/3A+2ldI9HNPNJd0Zr3qKMrfHOqQSJuIH0EW iCVgO5OVAOVv+U1pXKDQSY7O5anopPI6reQQ5a5m4tqcusa8a8Z86xn7TfRYyUXQdW2tu2Eke 6dHg00vwIcVwhdDAb5zsj4Ij8+oJgvCmM5K/vgzSTU1wD778948l53hjPdkAnA5rgOTSTJvR4 p9Ln1oehTuKLUj9GcfHkfZCUmnsvWHaGIVtdug0gRt4QFFthgo6ZmOfnQXPDUzgMGo34ViU5a QE9klpwt3x02v1C10Nm2zFOw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: >> So I don't see a need to change it. > > The comment ";; Symbolic link to a non-directory." should probably be > updated in that case, right? Apologies for the noise, in case I have > misunderstood the patch. Sure. I changed it already in my master checkout, after you pointed me to this. > I should be able to test out the patch later this coming week. In case > that would be helpful, please let me know. Thank you for adding this. Yes, please do. I will also wait for Eli's OK, and then I will push it to the master branch. Plus little bit of doc in the Emacs and Tramp manuals. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 12:48:01 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 16:48:02 +0000 Received: from localhost ([127.0.0.1]:59964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snL4z-00071A-9V for submit@debbugs.gnu.org; Sun, 08 Sep 2024 12:48:01 -0400 Received: from mail-oo1-f66.google.com ([209.85.161.66]:52262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snL4x-00070t-TR for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 12:48:00 -0400 Received: by mail-oo1-f66.google.com with SMTP id 006d021491bc7-5e1d5acb04bso77849eaf.0 for <73046@debbugs.gnu.org>; Sun, 08 Sep 2024 09:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725814011; x=1726418811; 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=J09BzghumrnHOjWH+OjEFgvnkg7PRnhOwz3DRcA4Mk0=; b=U+vicRF0uWyWD2OnpeBXXXMF/4HyQjxz7jt5FhNByhqgZ8gxxEFZc/2ToZKjzj0QTM FH4HQmLcA8ZZRwPxQ2QFZJZIr78b3vWqo2SF30It4VUuCpnRJyy6nJlH8FGfRlOP9aif JKT9T3AGHS2PndPhgC6f34JVhnqU4z/ijebsm8HcIo/vkv0ExNk15M/Rz4Vs40iXdvHu dj8lIcT5VIywVlkH5kVSFd02YJx03I1O+OguH2pBwt1Of77AGLJNel+vIZLswiyV1oY4 KELhJ9GxK8HxO70Ab8qEdGDxu+nWncGe0y+ymgBrnhMiroheibSQ30OFIRrnogRVM5nu qA1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725814011; x=1726418811; 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=J09BzghumrnHOjWH+OjEFgvnkg7PRnhOwz3DRcA4Mk0=; b=saUpDde7hA1Biadw8Xr1OW398zB9unMXKfdYZMbLijVkRUiajV0Prxde55SuVZ/wL2 pjFnW51PRc8Tl855AsO3zWtguU38V3qDcxT9hXpxCsvS62575KzJZvrpGL0dbHi0luzI FVdkdaZnXccOb3015xFe+KmZvsbqjFC2+1nv5lr47TIWU3p8X/Gzm9dtnrvTcw4Pk2HP HAdW1vFfKTA8Q2HPTzbA0HVo0chZpgMpazKUm/RSnQtD49vpkNTuivr6flSeXiX5oBlk PLvvkVYt8rodXL2xuGnGUPCah+W+GvlASuJsyQde3g1vGVzfHHOFscaV1YNJgy+udCWf 1qGQ== X-Forwarded-Encrypted: i=1; AJvYcCXaq89MkK/l1ddgflGt2s/gV/x6Fs6AG6JAhIXuHpIgl+u7zp113LPxWpYrhbkjPG5xPE+XGw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YysodysusqgPZvDqU6jxsPtCKIbOXfg9dCsKCqswbCbO2CcC+qI H0zLXGgivPgAK0EallmvylwCC1mJrYAXG2jrRaxHI+T5FbTXgy2ZHUWSutIX X-Google-Smtp-Source: AGHT+IG+aQ0wfFxQMdBkYdnMLK6Vwj6hmL/xQvuGNsWcjmyTA6dR/qrjkGPcTZpM6qaQds+CNe01Jg== X-Received: by 2002:a05:6358:61c9:b0:1b8:33ef:cc6c with SMTP id e5c5f4694b2df-1b8385ee4e4mr1086442555d.8.1725814010974; Sun, 08 Sep 2024 09:46:50 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a9a7a19a5esm141346385a.113.2024.09.08.09.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 09:46:50 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86cylew3tr.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Sep 2024 18:41:20 +0300") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> Date: Sun, 08 Sep 2024 12:46:39 -0400 Message-ID: <87ed5u6qkw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Michael Albinus , suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: >> >> Tramp is in a loop, waiting for results from the remote side. I don't >> >> know how to implement this differently. >> > >> > What kind of loop? Can you point me to the code which loops there? >> >> The umbrella function is tramp-send-command. It sends the command to >> remote via tramp-send-string, and waits then for a proper shell prompt >> via tramp-wait-for-output. The latter function calls >> tramp-wait-for-regexp, which loops using tramp-accept-process-output. > > Did you try either calling accept-process-output with a non-zero > timeout of, say, 5 msec, or inserting a (sit-for 0.005) into the loop > which calls tramp-accept-process-output? > > Waiting for a process to respond should try not to spin without > sleeping for a few milliseconds between polling attempts. A constant delay busy-wait would be better than what's there today. A straightforward exponential back-off (start with something small like 0.005 and double on each "still-waiting" case till something larger like 0.5) could be even better. However, I thought you'd be proposing something like registering a "callback". Out of curiosity, since I am unfamiliar with the relevant Emacs internals, would it not be possible to add a function to the equivalent of `after-change-functions' that processes the output? -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 13:53:58 2024 Received: (at 73046) by debbugs.gnu.org; 8 Sep 2024 17:53:58 +0000 Received: from localhost ([127.0.0.1]:60014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snM6o-000237-4q for submit@debbugs.gnu.org; Sun, 08 Sep 2024 13:53:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snM6l-00022s-SY for 73046@debbugs.gnu.org; Sun, 08 Sep 2024 13:53:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snM6d-0007fm-OC; Sun, 08 Sep 2024 13:53:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Jf56n6ixJThyOqaf4yT3+djeyhiXHUHT/2eZOz5Knxs=; b=QxEBS4rdRXrQ Gxelve7+zsjVwIpFWS2SJxkwEB8AnB32QC+mi0DNSzC34NK81zDTj8bID6zzeIQ8vv8vEkqrDXO8r X0PqR+E98Hh29Nc0Gn+TObDeNnia0S/sPnzjujCyt+5r0eq7L1mjNuhV77k2JWTaVyILhneEy4PkG ot2rDdNPE3DUbgj4Iaj4Q4UKZnOpQ2NYBnJmVXk/OavgnAgovBd3fPfr38DpV+uHqPpTVZ83t2OBX XvpgG7SQ4AWbLnCusOqvrB28AHGlI/dOl6nHVWfw09OCUkuYjd8Mcvcjajg9s/p7GhZXAs6JmgJjY 3/c9NuhdiZt+ri8H22vDSA==; Date: Sun, 08 Sep 2024 20:53:46 +0300 Message-Id: <86a5givxp1.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <87ed5u6qkw.fsf@gmail.com> (message from Suhail Singh on Sun, 08 Sep 2024 12:46:39 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87ed5u6qkw.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: Michael Albinus , suhailsingh247@gmail.com, > 73046@debbugs.gnu.org > Date: Sun, 08 Sep 2024 12:46:39 -0400 > > Eli Zaretskii writes: > > > Waiting for a process to respond should try not to spin without > > sleeping for a few milliseconds between polling attempts. > > A constant delay busy-wait would be better than what's there today. It isn't a delay, or at least the delay is not the main point. The main point is to yield the CPU, and that usually has dramatic effect on CPU load. > However, I thought you'd be proposing something like registering a > "callback". Out of curiosity, since I am unfamiliar with the relevant > Emacs internals, would it not be possible to add a function to the > equivalent of `after-change-functions' that processes the output? accept-process-output already does that. Except that with a timeout of zero, it just checks whether any output arrived, and if not, returns immediately. Adding a timeout will AFAIU cause us to let the OS preempt our execution thread and reschedule it only if no output arrives during the timeout. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 10 04:10:35 2024 Received: (at 73046) by debbugs.gnu.org; 10 Sep 2024 08:10:35 +0000 Received: from localhost ([127.0.0.1]:34751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snvxL-0004Kn-6d for submit@debbugs.gnu.org; Tue, 10 Sep 2024 04:10:35 -0400 Received: from mout.gmx.net ([212.227.15.19]:52395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snvxJ-0004KX-8O for 73046@debbugs.gnu.org; Tue, 10 Sep 2024 04:10:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1725955820; x=1726560620; i=michael.albinus@gmx.de; bh=mEfvTSiCO/mAVAWRPxm7qnXW/M8uV7fW/p2u7NJRM4c=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=MWnFS5jT34MUj2cj7mJF3o3MKEPh4dpYqntDEp7C3Gvi3m4gP9zmk9h3T3K4wc0n FuBhbnm9Aqk/O/k0s9tAzTY/77ai7RrzimbnwCtJUIEn3KSr34fgRGBpQ/LLbhuOO oC8qdLV5wqDv+LcSwMzwGwJxE30cAJv6RNEEl6DBDTEIN0LghIJOWshTQYa/rWT6b 15ZPe76Wb6dRdgXNaK9sAIC1m0GZQPz2pEMImrnqjpPTJGJYbTTEGMZDbTPNNHFRK ecRN0pe7cAx0lmtKLfVVOPR96OvKJJr3etOgkGwAB0GmwJocEpfnLmsRJh6MKZ0Nl u+NxdC5bbT7rbcBCng== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtfNl-1rsn7j1e51-0154uh; Tue, 10 Sep 2024 10:10:20 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86cylew3tr.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Sep 2024 18:41:20 +0300") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> Date: Tue, 10 Sep 2024 10:10:19 +0200 Message-ID: <87r09sexp0.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:jHBfDdSFzRdT6rNK7yqVyDfmagY3IhGJd1P++gCZjZrWtcWKkj8 rlwSZvMDDaLa+K+qSBPd6c5bPRk9BjCohrCW+qGJb/PH9Cnp5p8FS4DFRM7VfdlWXX8eXWK gbq3JMSPfuCmi4lXF47bINuiZ3YqPc2SRxSHWF3ERSL7AA8cyAgNxuljfxMY4EyUEUSjICu bwiCHdM1RLxPZh3Qifd6A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:lP0ZOf0CBSA=;psSNy9TWICszp7fZI1RxZ+fC9tH Bg6dxjG+d6zEmmpApOwzyKZRvDgbPbJlCPIqRBOr+Zge9uFgcgWuI2lyXtoMdP0PEtAHO1PX7 eo2wf/8fxTG16UY5XsrqznwiZTqz+KT4G9THinI/KeSd3o1M7MCZ+N8rvqqF9zQxUQE+ibDCA qyplycxbmuaWnJtynn4+v3X4M5OGS2ynTkWiI9/MXG4e1AukC1YsVkRXeXuEB+9RPzTRU0l5M cDeARnSvnd69U+1VL5cY12PzgGWAJmXrLR+gR4Pl7kj9Dgez4a77s4ibIpNCtQjWnxrgtEaw7 8DMCbZOI65yD1HWF+fxqCo10b75bJRoxCSdxw+igCpuOxn4qTalYAOdMCDS17YXF1Mc9pMadJ uJkt3TECITeUb9wnQG7PsXMSymN/Y9Gb7Xd3VfIK3Z3grSjruQiPNp2pRoptxBEXfUfVPlkEq EEXp1Y2Wf9JBcgnGZFKEAb2w8tuASzQRNqFEad7Jv43Dh9XZIe+NbZZF3fULEcuwuS9RZEwFS HcKGmIgX8jdWmStFiroR2U7CEbMJh2/ncUYgyu0ZP+4YI5juUtzLyW8ACUxHHnvTwUcYFdmF/ Vw+Fjap/z6YBo5gUubYTMI3X2NVAixWntS3uoMRzBqjhdOHfx8pVoFDvy+p0XAbk8ULZRNfNq UQNYlXRLm0sSV7s+qNVEzoH0kCcGzVbykTCSru0dCaH6ekg2teFBLOcrxxSdIiY7X62T3KOYv nGaKWj+Zl/OQ43PMNsef2pLUwibG20m5TXAYJJnyA2XT6IccImw4JopDUN9rHZI4qkDBN7OTW yO73ER99Hp1wTVgBVGSvf8pQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, >> The umbrella function is tramp-send-command. It sends the command to >> remote via tramp-send-string, and waits then for a proper shell prompt >> via tramp-wait-for-output. The latter function calls >> tramp-wait-for-regexp, which loops using tramp-accept-process-output. > > Did you try either calling accept-process-output with a non-zero > timeout of, say, 5 msec, or inserting a (sit-for 0.005) into the loop > which calls tramp-accept-process-output? Tramp used a non-zero timeout in the past. This was removed some years ago, I don't remember the reason. I've added (sit-for 0.005) in the loop calling tramp-accept-process-output. It decreases the CPU load from 100% to something between 45..50%, when waiting for a response from remote. Pushed to master, and thanks for the explanation! Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 10 21:06:54 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 01:06:54 +0000 Received: from localhost ([127.0.0.1]:37200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soBos-0006PZ-Bp for submit@debbugs.gnu.org; Tue, 10 Sep 2024 21:06:54 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:53359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soBop-0006PK-Uk for 73046@debbugs.gnu.org; Tue, 10 Sep 2024 21:06:52 -0400 Received: by mail-qt1-f196.google.com with SMTP id d75a77b69052e-4584f9468aeso2506861cf.2 for <73046@debbugs.gnu.org>; Tue, 10 Sep 2024 18:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726016740; x=1726621540; 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=jIROTQH6dxVQ9yPzyx1SeWTQnATf7ZI7vCzunyi0P9k=; b=kuz7MwTD7p4eFzKsP0/TU6Ai/GqFAy+bLusxsBPE1/yX1SOb4uS/MT8pvBpp9P/k76 XolCIbLX3fPQVRRFSe/rG8Hx72SeMyzUkAVEQR7D6lRP3ksTF+EYem7Jo7lvIrgFf9lB wNps965JTJ4hOvjq/XpnzQ9w+DCcIRWjmL3AlycpK86Ipv4FLQgMNbKDIgyTjcxL7xJJ 65nOiogWs+cWnlIjb/FjqVpu1zG8OBpbtyQqytYn0+qrfARKnzWZsNBIospTBE7oScEq YomxhDHbazEA3hQoSWnM2bxDYipiddX98/p2KOVHNHZT/SSKqCqjHfXeZ7kqKT8WLClb 5MzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726016740; x=1726621540; 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=jIROTQH6dxVQ9yPzyx1SeWTQnATf7ZI7vCzunyi0P9k=; b=Q3/Wz+IYLElOviWOoHqE/Eh48ytBX25uMvHzVkf94lhQmhueSJnXPwg7vkSmgtIERH uQDm2o6sZkE1Xs5qPo/w6FQlqIjZ27VoYB6LuimZVxzcVFnYHWb/TPxvtJgqGPJQHoyg dlbj/kerNcvgFe8lsauwlXBn7KLYmqpsRr/sCKn0uzZEgxNT3e3gZlCs+tuxxzkvESPC hsrxgeEA1GExgTu7Ovocs4ZXnTQFboqWW+ldDa0AtD7gw0AFSlDtXVad8e7kZeOzcmFo 9juFFAczPWlpzNHhWCMtii4L1rdFfT846IowX5zIzLIMVMdqO+GWaQYfHn17FLNRO+fV hVhw== X-Forwarded-Encrypted: i=1; AJvYcCW3u/zJLi7wptHsHOq1sgwQ+K5U8fXF7qlmdRx+dNdQUYI88V8CECKTjnNil0BCDGFs7exysA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyRezE5lW0l8yVPHRG66mwtiwSSmd7uGIt46TK8k6NDpbyFMlyR IlhgfCY0Wq9J6+FV0QKmhRalgIgXGTGUKoRgJBlsucIu5I2sNpO9RVPmp+7j X-Google-Smtp-Source: AGHT+IGrdA/YGIjqvi2cuPvnmll7xMVNXUUgcSOb8NIcAmAu1fTmD3VR4jcVyiua3fao6obCzLdgaQ== X-Received: by 2002:a05:622a:2c9:b0:458:3d1b:8de4 with SMTP id d75a77b69052e-4583d1b921emr80830631cf.39.1726016740352; Tue, 10 Sep 2024 18:05:40 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822f957easm34647421cf.86.2024.09.10.18.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 18:05:40 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87r09sexp0.fsf@gmx.de> (Michael Albinus's message of "Tue, 10 Sep 2024 10:10:19 +0200") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> Date: Tue, 10 Sep 2024 21:05:29 -0400 Message-ID: <87plpb6luu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: > Tramp used a non-zero timeout in the past. This was removed some years > ago, I don't remember the reason. The timeout in tramp-accept-process-output was disabled in commit 54ef338ba3670415cf47fabc33a92d4904707c7e . The commit mentions bug#61350 , however, it's not clear (based on briefly skimming the discussion there) that this change was ever necessary. If not, should the timeout be reintroduced? > I've added (sit-for 0.005) in the loop calling > tramp-accept-process-output. It decreases the CPU load from 100% to > something between 45..50%, when waiting for a response from remote. I am trying to better understand what's going on, so the following is simply for my understanding. Use your discretion when responding. IIUC, we're still actively waiting for the output from the remote host, but simple not _exclusively_ doing so thanks to the `sit-for'. Is my understanding correct? If so, isn't there some mechanism to specify a continuation that's run once the TRAMP process produces output? Such a mechanism shouldn't require a `sit-for' to yield control. In other words, isn't it possible to do both font-locking and getting the response over ssh concurrently (of the main thread, as well wrt each other)? If not, are there technical challenges in doing so, or simply that it's not been implemented (and thus, possibly, we may not know what the challenges are)? > Pushed to master Thank you. I can test this (applied onto 29.4) later in the week along with the `dired-font-lock-keywords' patch and report back. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 07:50:36 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 11:50:36 +0000 Received: from localhost ([127.0.0.1]:37871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soLro-0005aY-Cf for submit@debbugs.gnu.org; Wed, 11 Sep 2024 07:50:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soLrm-0005aJ-3q for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 07:50:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soLra-0003nV-Dp; Wed, 11 Sep 2024 07:50:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oqWO3KNbBVjn+x0Oz8hFpfQp1Sju/loB5sDHRPtfPH4=; b=GabzxpYWTK84 oDyH8/9vAGh9QcQqqXNLKceHL3xhtv0m4ChPVIZ7JKq3TkGDW5JoAd0X1ARqVBx+vucBOhamidlu7 R3fNk3E0638BZutRV5WNj2EMy2WxQAtD0WbIcVj799Prybpjnf4DbBlD57A51p82XuAvv/nXiRgJO u/bvlc/1S15hslrkQC/VRN3M+XmQcMnEJ8dweGGFVOXbSaOfMU8EUIJlM3C2nbb+nvursvT6LQWxK ieqoHBSGMNuTdmRSOT0E2lv6bCLlqzK67RYdzmGoIvQat+ta5SxyJatgZgddbT4r9CB+tC59w8OD5 j3NRQaFE/Q7C+n6CS+4FKA==; Date: Wed, 11 Sep 2024 14:50:14 +0300 Message-Id: <868qvypfyh.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <87plpb6luu.fsf@gmail.com> (message from Suhail Singh on Tue, 10 Sep 2024 21:05:29 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87plpb6luu.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: Eli Zaretskii , suhailsingh247@gmail.com, > 73046@debbugs.gnu.org > Date: Tue, 10 Sep 2024 21:05:29 -0400 > > Michael Albinus writes: > > > Tramp used a non-zero timeout in the past. This was removed some years > > ago, I don't remember the reason. > > The timeout in tramp-accept-process-output was disabled in commit > 54ef338ba3670415cf47fabc33a92d4904707c7e . The commit mentions > bug#61350 , however, it's not clear (based on briefly skimming the > discussion there) that this change was ever necessary. If not, should > the timeout be reintroduced? I think Michael just did (see below). > IIUC, we're still actively waiting for the output from the remote host, > but simple not _exclusively_ doing so thanks to the `sit-for'. Is my > understanding correct? When we call sit-for, we yield the CPU for whatever other jobs are waiting, so we don't hog the processor. > If so, isn't there some mechanism to specify a > continuation that's run once the TRAMP process produces output? Such a > mechanism shouldn't require a `sit-for' to yield control. How would that help? Tramp must still wait for the response to proceed with what it does. > In other words, isn't it possible to do both font-locking and getting > the response over ssh concurrently (of the main thread, as well wrt each > other)? Every Lisp program runs in a single thread, so how can that be done in parallel? > If not, are there technical challenges in doing so, or simply that > it's not been implemented (and thus, possibly, we may not know what > the challenges are)? Emacs doesn't support parallel processing, because introducing this into the original single-threaded design is very hard at best, due to a huge global state. We have Lisp threads, but only one thread can run at any given time. > > Pushed to master > > Thank you. I can test this (applied onto 29.4) later in the week along > with the `dired-font-lock-keywords' patch and report back. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 10:07:12 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 14:07:12 +0000 Received: from localhost ([127.0.0.1]:39291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soNzx-0004QB-EL for submit@debbugs.gnu.org; Wed, 11 Sep 2024 10:07:12 -0400 Received: from mout.gmx.net ([212.227.15.18]:50879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soNzt-0004PY-BC for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 10:07:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726063610; x=1726668410; i=michael.albinus@gmx.de; bh=i9u3HNkSH6PneQGEWhBJFvdPZhoqq1IrCY5tXaqZmI0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=ZQ/kyhEbRAQ/5R4U8WWEz2WON8SiV1/3EUSLURR645N3VFkhFdYZ76PfuW3YZPqE LU7wY5osRT4SFfr+6MnC7DqVIHkZOjunvpMncoIx9UxEbi0x/io9OEvMFlBs24fAv +jqct+88KqaYz9qDhExR+UjNPArRkDInSzUlVJ+graXNVN2OIMD0PTXcjTGMGreI8 9lAH98o/raooS/9Yy8+RojozzyPRX/qVLnZEwSkUIxtmE4O5Uz0NqRHK5H6abxZmS OF2UvrFn+TWPhrh5bBRn1OPBv1UFZAhQd2DTlyqpXVwgma9Tys6HuzGYXWfId2b52 ZFxzcmXSWkC9Ek98dA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MY6Cl-1sVTWB0Lk5-00HwPb; Wed, 11 Sep 2024 16:06:50 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87bk0zjzt1.fsf@gmx.de> (Michael Albinus's message of "Sat, 07 Sep 2024 16:36:42 +0200") 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> <87bk0zjzt1.fsf@gmx.de> Date: Wed, 11 Sep 2024 16:06:46 +0200 Message-ID: <877cbiffnt.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:vxkqKcWQM1lbRna+24VGNIT7Lx07oYnX7Q3V+UVYcF7/ZrDWTbK AZkC/lXCwu2kXt8IAMZHtY3kq9xnKuFxgEl6hx+Vo8a+KZcixDGAmylGFeMZioCXNsqajIe PBlKs7niqQJjh2Pi8zcjDhb9mA8eIlOlqwIrS7Gu5sQs2nhBT9N0z6tc0tC4Pi5Hego8zgp oyBoAfLyrcaMYdLHuagDw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:UNa3E18qQio=;Xt/GH8eGYHwJBISTV7mRZ8zGjeX EtVpez6Ssug9N+kA2Upwg9CHs5wF5x77rIk5wXIfzqgpLRZWTTY9AFByVlwPVQE1f+fV0DdMC k4AoRedJ53Tz0xA0Aczu5Eo3tnfqhFmEKsqI/cuoMkhwBYemwcobTqU5j2jBhDyR4G1QX0XHg EVbKf5XZduXLssd4IXKf1aXtRKKXseaJMRyfiiRDamfe6gPDZAkGaV4EOMDf/zZQ6W3wyPkrz DR9b9Pg5xJTPioojXTNWI7ckyeQ7x9td8bRahK0SCWVNwJA1rxl2KiN5sAG8MjjGqnjHIt8Ad hYk5+/1IT34iEZayrhkNd1/enKKvSo6g0h09aG4Sb3jJ8Kl+FDIhUgl+/laBLmLJH+71Y1i4z jr9eHmkItbCPGZD/5CBwsX0jb83z53RF5d7Pexc4T9ovyuC+RMQwtX/kDFZqmF2yqnAwGobgd QnyWExzCWGI1zjn0KrSt9M62xjKbA3RNoIZTzJxQ8Um3i02/QJnaB5hXX3aXramnh99Wa3awT O6WvtQw/azXLt17ZMZAorlEppygL6CzRH6pEiU3t8FkqkmofoELvOIGtU7JbxwWYveUvWKT54 DwvP2FB1G00dpA7FmtaF5eyBv5oujz3D0nN+2QHBjKJrJAiIbheN/l84W2F/qG9n/EAT8dTrf W69bSbF25HgEJyhNerxcjkMIzfocombatKAPYiphcGt3IMQpbVvlbnzLRccRdat2WzW1oti8S w9Sta/QMxTtGWL5SrUYM03kW2+BYw/E3njZPJSKjcFNlJ+ZsVCVzboSGFuM9cEBJuHfNd2Dzi IUWRXUmCzwpcpXiyaubpovEw== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73046 Cc: Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Michael Albinus writes: Hi Eli, > I made a test. In a remote directory I have created a cyclic symlink > "zzz", in order to see what Tramp does when running dired on the > directory. The additional actions are [...] > 15 times the "test -h" command - I guess, Tramp shall do cyclic link > detection better. I've analyzed the case in detail. Tracing file-truename and tramp-sh-handle-file-truename. --8<---------------cut here---------------start------------->8--- ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! ====================================================================== 1 -> (file-truename "/ssh:gandalf:~/tmp/zzz") | 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz") | 2 <- tramp-sh-handle-file-truename: !non-local\ exit! 1 <- file-truename: !non-local\ exit! --8<---------------cut here---------------end--------------->8--- 15 calls of file-truename (dired fontification), with 1 call of tramp-sh-handle-file-truename each time. That sounds proper. Tramp doesn't cache erroneous results, so it doesn't remember the truename of "/ssh:gandalf:~/tmp/zzz". That's it, we can live with it I guess. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 10:14:05 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 14:14:05 +0000 Received: from localhost ([127.0.0.1]:39304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soO6f-0004ml-7W for submit@debbugs.gnu.org; Wed, 11 Sep 2024 10:14:05 -0400 Received: from mout.gmx.net ([212.227.15.15]:59691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soO6c-0004m5-C2 for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 10:14:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726064025; x=1726668825; i=michael.albinus@gmx.de; bh=UFJv6NXXzHIsO8+iaIdkWom6p9EeTN4gurK4IlVI+k0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=GRMnrfzipzibY1WFSQiIyC8BTjCqOVOdfKuysFNxF7ZD28343k3RO1E6dX9HXFup rqUAxxWJ0BLFq6Cfc9XjoaAgChJ1X4to7WsDNdfxNxyVmcL8zc4J+bGVT/5vIc92X 9CQwBCQMNdJCAkalai9+skJCBN6sf4SQ9k7gW23scuGpbnqxIFNlnej5JdByqTfW5 p9pUQ2p8MOwNxn7VS8XVWtx8iOl2lY9YXwzPh54/MV64Yv4o6TQaf0UG7MDsMquEk UbmZbkrZoLQPnAqj5NwoW4b7vIHnspBn7ACJXgJq1BB5R+8OLf9LsBhCswCkPGqOi os09iQ57rKIzRIb/gg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MgNcz-1sN35y0U8t-00oHNM; Wed, 11 Sep 2024 16:13:45 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87plpb6luu.fsf@gmail.com> (Suhail Singh's message of "Tue, 10 Sep 2024 21:05:29 -0400") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87plpb6luu.fsf@gmail.com> Date: Wed, 11 Sep 2024 16:13:42 +0200 Message-ID: <87zfoee0rt.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:nYtddW+vsdGY7PlcCUfev25/FiQ/Q4Ht6RlGAO1k5NjGRbx3qnC tF17lGLCjZefDi5QdCWBlaLyH+tjBftgEKfaLtlqb3KqlYbdBqlnvHgbCcb9d5LmpFlxEoL xYYYy0MxSvgJ0JXiZ9+jiF/TiyrjimoCD7QBVz3oeemzWiJRjCAna6SeHY+78xff5lS5y5L AwON8SQtBZNGuuMfYZswg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ncHnZlFE3CA=;Y2MVUxJtEAfr29uTz2Xpj0m+IwS DaqPUG79/D8iygJL07rOr6KJ+1wwW912BmHIOG+jKEqg0LTRW0mYZCgmXXzBiKx2+Myo1hg2g 1zq7KO1c3tBeciVMBis6OSXVAmDvkvOlNHWWRrJyC1Hb5qytl2R8nkkxOu0TVmaA4uq/DsRfg 0+see+BNbshozZHQcY0ULkCN/R1ybJrLiYUm50GWUmjBxCVC3729DSV8mJS9Mcz970ySQ9Drs jVzslloizMqb41n8gIEYmwRl19XmiTkxE0QZZkCrSYz2y8PXVWr7WhT0aV53YH8plmDNCy2Lg lMlR8LINy2+khbgE3gvQ//IZqrTfB7Z6BUzn4sRrEoehOtIVTlha2a1xwzUpoZCklTv814WOK KbPcNu94q2I5A5zQclMbegRJ73uQVN3/69eAyhFkg/PFmJiApBZ7NtearJVgn1+YYUVV85VM3 9yRrpmAn4WaKLfxmyZGzdJkYLEc4p769t2z5p3Mxcy0rS+yq+2edNn96gV59jXdj3fEeUFCpm 8gEQZqpap2vWYFI3/0BzJQa8m6F0hwpl+nlc71whGOXcYUdswQ2IS+GfOvb4/3TVVPOp0WxLe zUJQ6R7vb4AfMMlBBxMfPN3R6sNL8TyT5MtYCSLM6qUbITqU1x4aXKFOk3wNAiLinhf2j2KB2 rXshlFc3ln5tWIhZu8a/0T5Oc/zch8aoNc9v+Bazfz5XoAZMnyEySoGcwUyTegfL7+Y2HK4JL +RI5guVc7T8kLsmgRr9MdhsRSJCDqdImxs0o35xHRQ76Z6cbVqWhunwRjRKxKbbQsvg28+8hj HcSBpKzlViIPs3eqjArVIuRg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi Suhail, >> Tramp used a non-zero timeout in the past. This was removed some years >> ago, I don't remember the reason. > > The timeout in tramp-accept-process-output was disabled in commit > 54ef338ba3670415cf47fabc33a92d4904707c7e . The commit mentions > bug#61350 , however, it's not clear (based on briefly skimming the > discussion there) that this change was ever necessary. If not, should > the timeout be reintroduced? tramp-accept-process-output has seen several changes over the last 19 years. Some of them with collateral damages in edge cases, which needed another fix then. I'm happy it works stable now, and I'm reluctant to touch it w/o urgent need. That's why I have used the (sit-for 0.005) solution proposed by Eli, outside tramp-accept-process-output. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 11:57:37 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 15:57:37 +0000 Received: from localhost ([127.0.0.1]:39462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soPir-0001m8-A7 for submit@debbugs.gnu.org; Wed, 11 Sep 2024 11:57:37 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:43201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soPip-0001lv-6z for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 11:57:35 -0400 Received: by mail-qt1-f195.google.com with SMTP id d75a77b69052e-45812fdcd0aso9743821cf.0 for <73046@debbugs.gnu.org>; Wed, 11 Sep 2024 08:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726070182; x=1726674982; 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=Pz1EyfOlG9miqaNBiCxp+T5DkyxXPWqRmZrJla3QWTM=; b=k+jxsnNcZG+d9ycn2is4M6H5xy3u7yyMwImXDkW1YPDZ/Jvvtgr/xiIvTZNhB7v+gY KAY/Gixp0aOxy1l2mcp7a/cXA01Vik0y6Qx+5pNCPocpvUSMRNmbY7dwRsb9t8zDwB7p BYZmvpfA1LJHi/aiCQXRUrydRMx1eUcgWJUbLtvTbx9vy7KU+N3jYwH97BSTTqf03iJS qcpkk8h15Z/LB9LQmdmUhp9nSsWd48ZLQHJfaBlva/yXRazLOUA+RN2UwKlMtO7A1g7x 0uJWjU5fjyAKb3a5tOBsqSRiwLfnexxGDTEft9H2ISkS7r+R7nHkJPU1UnjgvH0/u8it /jOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726070182; x=1726674982; 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=Pz1EyfOlG9miqaNBiCxp+T5DkyxXPWqRmZrJla3QWTM=; b=v5RsV2A5RyAWEo4tNK7Of/cSOdjpQmTDO3iNDl20V/6igrl9OpKAFhIT2+LWBcXBwW T88K5hIcdaJDDxIwz23S6TnXRna0SjMulDOid51EUUxkmRMpKxxCJObCSi1AHAVWDA8d dxLSegqML+41xm2P+ajmXWVKLZaaB2Y/8ReSPx6LoUIaNPMYGZiqf2eiwWtslfTXlTy6 btSR/gXCNpC5Y61pX5etXtOO5pEJjUkUMoKKGOakBbB0CWdV9sq+tqbdE6Aux/S/UkH6 BcMHAtsQFRGOCdDt3NWzI80EJBDhuVRVMNpB74SjvBqAeVyuq2x0B54zxKd0CLCh1L+o CULg== X-Forwarded-Encrypted: i=1; AJvYcCUvGQIcf/wudA76+GOhFc35CwT5k+GRisBPvLsCegP94ILEm/C958rJsUPdv3HZI8mg2WxxGQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzm1lOtalwEvPqNifUMLMAkpOdEh6qCtBa9LyB+yDhEzM+aA9bs BBCf1LjfUp7YFx3bmyLJ78UwR70hnNKh+5nmMZdzlyL5UAr0mdAoC8IwaqLq X-Google-Smtp-Source: AGHT+IG5nOk7K6yITYuM4jfkeKZlWc4ouyKiPFey1eCAfG49V2hBFKG3j+hN7Kp1wOodY3C2rhYQJg== X-Received: by 2002:ac8:578d:0:b0:458:367a:33dc with SMTP id d75a77b69052e-4583c71a07amr126044741cf.18.1726070182158; Wed, 11 Sep 2024 08:56:22 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822ea0d6asm42708631cf.51.2024.09.11.08.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 08:56:21 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87zfoee0rt.fsf@gmx.de> (Michael Albinus's message of "Wed, 11 Sep 2024 16:13:42 +0200") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87plpb6luu.fsf@gmail.com> <87zfoee0rt.fsf@gmx.de> Date: Wed, 11 Sep 2024 11:56:10 -0400 Message-ID: <87a5geyyjp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: > I'm happy it works stable now, and I'm reluctant to touch it w/o urgent > need. That's why I have used the (sit-for 0.005) solution proposed by > Eli, outside tramp-accept-process-output. Understood; thanks for elaborating. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 12:20:01 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 16:20:01 +0000 Received: from localhost ([127.0.0.1]:39483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soQ4X-0002v5-AT for submit@debbugs.gnu.org; Wed, 11 Sep 2024 12:20:01 -0400 Received: from mout.gmx.net ([212.227.15.19]:59675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soQ4U-0002uk-3H for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 12:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726071585; x=1726676385; i=michael.albinus@gmx.de; bh=3t+eH2nnMxVJr4rVHwgK16OQaSGyAq0IJrPjf74cV1c=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=gCl+OB6IfQBUeY9C5PaEYNgF4pUfW0QZTVxUi2Tlu8YKyJdXRZyIOX9JkVlzfAAj sdkXNUPIeucnEN2a0ABU06p+opk06ShuT2KjFqZIS6FWXocdcarMaqXwqRmSOCZZC QeCuvPvr3cOrq6oVoZsWJek8seOHTbJew20zBT3OW9BbuNCSgwyshJN2ez4cxEnmw fSZhx07SolOVKeHVhMed+nu0Y527TWSmjc7N46dYEktAkmOrhoLRzH3LSjxVouqUh emlPZKp5Bmpcr5BYHoU14zguwi/1K6f+chwO4LIvOhl04CeNtKgHT2fv/AiWLHXan 6Frye1Pf1W1fRn+f9A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M2f9h-1ss0J53WqF-00E6Vg; Wed, 11 Sep 2024 18:19:44 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <874j6qgl39.fsf@gmx.de> (Michael Albinus's message of "Sun, 08 Sep 2024 18:35:06 +0200") 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> <87frqbk0fx.fsf@gmx.de> <87plpf2vnx.fsf@gmail.com> <87wmjmidyt.fsf@gmx.de> <87mskii3m5.fsf@gmail.com> <87ed5ugokg.fsf@gmx.de> <87frqai2h1.fsf@gmail.com> <874j6qgl39.fsf@gmx.de> Date: Wed, 11 Sep 2024 18:19:44 +0200 Message-ID: <87frq6duxr.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:w6ZjGufQqHEONlq1DhhBJW8c6RsgE+PxZvL8zuEw38dG2fDXRAd TAfWK0hzhhFrGHHfZ2KnvJvXNCwq7s2W2uJdHbBq4rt4iN4lizqFsEIcVMwcYI/xClfErB6 x637lHWzCgz5YaHzOXYDBT6mnwz9dbqRS9MYdcyIO5Mx6HlRZHCzD5jTElo5lAJ1nzHyD8T krCAdT0FsN4DFy4FJz+jg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Ij58Tp+UDsw=;6kaP92c/ROwLvmnz7m8oFDoQo2E WXAS68NATMIgDbCJ642QYrW5xWvixMDj6j/k32R6rJBA1+X66m5VyOmBIMbhPv0Whw/uvoAOl YuINLWo1aV8VDZmqGXoNt1yKajt88xfJOgaWdQ3E8volne2WS+9rjOonu/fX991cB5lZmugpC SG+T5MYBnhQiRqgCaDbMpNLtO4mn9n9Sv+001NHNRZpf8OTRLvXz9R65IN6mx1t/B6QumNKlM JiQ1X/he4aIcWWYZbGXhpte/gAodg6Qw8TPrrwRyz1krq61Yj6cLHapbQZIE366JOzcr3pkLL t3njmlSjCD+KZmHWoKlN4+fgdkRDoLYkEJc9uGtZjWBmBQ2hHyilvyh2kHmMo99nZxEiJDR5A QLq/yDRbn08mphav9ngAkEOsMXK8wU774x8O+FF89vqjFu0ImKf1gpwcJOhq7NqxrJaoDLONr vOgWJmQ3FP0NdquNP78MyshRvbIlBS1l39YKQJuMxxjxb0iKwiFOAtyPCJgu3h54EwnalBBUP ASksZk0De9prD7ve6aBHF+LRXx8tjWjZjiDNS66GvjuTduGUdQsE8D0o5n0Oe9LnTh4q9K436 mEto2wOJuoFyeKxSL4gJTANm0KWivjgQATOgRntcYwvFzEC/+m9Q2eLlmg/LOgppIsRRItiKh CGqnXwB00iEbkhId9fkwmzUZrnkEnP0tTCsqlXhBW4tSzVhK7U+qQrehdxkznAglIMKZ/J98E UgosOhYIoNJHYit+bPXMub/SXEpQkUSHU7bXLWTxo56hQNB3YTG2kGv+K9htyn9hX+5HWekp8 vc71Xb3b6ep1JzMKDqrEH9/Q== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Michael Albinus writes: Hi, >> I should be able to test out the patch later this coming week. In case >> that would be helpful, please let me know. Thank you for adding this. > > Yes, please do. I will also wait for Eli's OK, and then I will push it > to the master branch. Plus little bit of doc in the Emacs and Tramp > manuals. Oops, I've been over-eager. Pushed already everything to master. Pls send further comments, if any. Otherwise, I'll close the bug in a couple of days. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 12:30:49 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 16:30:49 +0000 Received: from localhost ([127.0.0.1]:39495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soQEz-0003c5-8N for submit@debbugs.gnu.org; Wed, 11 Sep 2024 12:30:49 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:51690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soQEv-0003bq-P2 for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 12:30:47 -0400 Received: by mail-ot1-f68.google.com with SMTP id 46e09a7af769-710de2712eeso1895499a34.3 for <73046@debbugs.gnu.org>; Wed, 11 Sep 2024 09:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726072173; x=1726676973; 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=dIX9rhz4P3b6Q2MPV0BQzD4dz9L0uz/B5siHSgNXAHE=; b=Y/7Rt2/TAIhgA5GpVg/yCPHs1vJ/+WMA7HwYAU4SMTI2Sm8C8+GtO0qFL/qcuy2+86 7BvkWnDtvK8SYWd2hlU3K3PX7hWJHDAl/9hUWNVsplgBxD3mHbSZszR2dnbUtUc7O541 MstCNiJiPGz3rrMokDLBE+QeECFiWftc+JT79LUlP8bNFapxnGEnrWuLiCuk1cZxjVtW 4vfSeaYCOjUXy015WNOfu+JEtIU2RVn/GP/fU1F0+odYDG07mLcf3btl00D8EoYh/J++ 3e1gdRDcC5zUSYUYnMCB6WvXVF1CWRzUU+xnh5w+PlRTgVfRTaKYJQXNTzSTvW5bzKG6 4Www== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726072173; x=1726676973; 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=dIX9rhz4P3b6Q2MPV0BQzD4dz9L0uz/B5siHSgNXAHE=; b=aycwd1pvZIy6/KCiZRbpsTAhCVC+V9UmLSpVEQL0NgzU1d6ZWcTMXSpEkVnqjZTi46 KZWfqIzPCnDB0HdpnHM2wVIIZ7xM28P9AzzzOpMoLgCqoA16yt4m/gnLou2eQhxaaEuj pVgalK40goZ19hlWjPC7ph6Kl+GY+CnlP/7DXldKw74+lbKYaFQnmbk0nz+N21eaAe7r /zNjTZVD2MfYSTAwV7kUn+XTbQ36M9l2+7hJFiuAfpNnTRYbzdWb/8ufk1eXz3DMjkzx j1Ve/XaWcV5og0cRMAfhqrjZnz5eNT6S0qw0xUjPKJn9YzzvE6yH/pgkFwapTP3TqOL2 u0uQ== X-Forwarded-Encrypted: i=1; AJvYcCWqwXLmUFQ/q86S+hEhV8FySoKBWA14yPjc156EPl5DKCaU5mD0Qsm0BuCDBBAjDVc6wx76vg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx/TxbukQ0ppEdQ0fecTsew7g6d53uYGea6LF70Qswwukr9eTmP cojM+cLN95VtktIFr5YwhK0X3aNY2v8oeSa/wPMDBefqYcCwAX/SlJ8jJ6zh X-Google-Smtp-Source: AGHT+IG7ibGyG6U14WkS5XMhmY2o/e9iZtmZgm2kuyn041yKU0qlYJI3IP40BGCz4VzOk8NNX9W2gQ== X-Received: by 2002:a05:6358:3204:b0:1ad:95db:b6f2 with SMTP id e5c5f4694b2df-1bb23ddcb5fmr17839855d.17.1726072173188; Wed, 11 Sep 2024 09:29:33 -0700 (PDT) Received: from gnus (bras-base-mtrlpq0776w-grc-23-65-94-70-53.dsl.bell.ca. [65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822f939b3sm42772081cf.81.2024.09.11.09.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 09:29:32 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <868qvypfyh.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Sep 2024 14:50:14 +0300") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87plpb6luu.fsf@gmail.com> <868qvypfyh.fsf@gnu.org> Date: Wed, 11 Sep 2024 12:29:32 -0400 Message-ID: <875xr2yx03.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: >> If so, isn't there some mechanism to specify a >> continuation that's run once the TRAMP process produces output? Such a >> mechanism shouldn't require a `sit-for' to yield control. > > How would that help? Tramp must still wait for the response to > proceed with what it does. > >> In other words, isn't it possible to do both font-locking and getting >> the response over ssh concurrently (of the main thread, as well wrt each >> other)? > > Every Lisp program runs in a single thread, so how can that be done in > parallel? > >> If not, are there technical challenges in doing so, or simply that >> it's not been implemented (and thus, possibly, we may not know what >> the challenges are)? > > Emacs doesn't support parallel processing, because introducing this > into the original single-threaded design is very hard at best, due to > a huge global state. We have Lisp threads, but only one thread can > run at any given time. I was imagining a version of TRAMP that was asynchronous. I understand now that it isn't. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 12:39:08 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 16:39:08 +0000 Received: from localhost ([127.0.0.1]:39499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soQN2-0003yN-8I for submit@debbugs.gnu.org; Wed, 11 Sep 2024 12:39:08 -0400 Received: from mout.gmx.net ([212.227.17.20]:53851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soQMy-0003xp-J6 for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 12:39:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726072731; x=1726677531; i=michael.albinus@gmx.de; bh=dDVTbDtLqo6TYrynfLkTNxpjdH8VFOxygndgaeOHl04=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=KXmquNQENDpW2fDdn+RLoMc/scWodCDNBpIQfHxXS3duDA0zRT5jQmkKT6bMsA7H 1mR1hfbWibuI6Q2r4z00ph+20r+an0mdS0+aUALq3MaSc9yuApJM4mkLvU+TNbZvY xLVyRplonrtmTt96ErumCFZbRBu97CR1Yz1FqHFsW46AlDk6BPgVuUiBuIwj9xhm8 dj5vxLXKESN7oJi+CwVNQKNxzXwO5Nmt1xMSFBgLTsPcKidrU4qpk0uLRCQqXpBBG ww93Nyaa0xOhpkQMC1JTzL9KWyPiXpxPu6wx84lk+alnl9zgnkj3RbBXnTH/QLCvt lBuXpFYr1WifY09WpA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MeU4y-1sGBTi41hs-00kVt8; Wed, 11 Sep 2024 18:38:51 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <875xr2yx03.fsf@gmail.com> (Suhail Singh's message of "Wed, 11 Sep 2024 12:29:32 -0400") References: <87o75241qh.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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87plpb6luu.fsf@gmail.com> <868qvypfyh.fsf@gnu.org> <875xr2yx03.fsf@gmail.com> Date: Wed, 11 Sep 2024 18:38:49 +0200 Message-ID: <87a5gedu1y.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:5q1IFFEvh0ux2jo2prQ713axi5e8Buncsj0w/yKXvrkmNkdaRci Y9o8R3DiS7b55FN5fBTm+Jo8E6ZYE0fKM8BRMiiAkiy2jPcG3ef9QytrpX9zyJxgXGaafEr wDz/D1WexSqQoD0GYXH2WypuVtofXpEKfaXB9+3GgW7vlDQ4z02tJg2d+s8udUPaoactdTH aBl45We6qPoUKl/76RsYQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:/VL9UjsbMhM=;tssWWlc589B4k6w/kUX10mtGHWP CWTG2I10lFwkiKOhLURTW9Iwhjs0kE3pzAlyPnPXib+fsySY0neuUo9RAn/rKMuO6SMKPZ4Dp h7yPO+M8Mum+EHrw2INK861FiExLT0HtE65eUKaEgN8Dac1EJ1GeBGD1bKrNZa0x3pNVh5Qsf 4VCjp2slCcicrjq/QYvSn0Jy5NFqifRLVe+CO0aEiQctC/JsoQWkkv15iCjNwMhaJmkAsHrHO yurJccWaW7MYLKP9wFyBfsekhRGRJGX9X0m6OSCqzdbs8kz63NoS521HELpdxbaO/XAUSTaDA e2sGt3cKED4X7IKLzaRpWpAI9h1i4wwmFAGgdCn0VRRh+5Hyu7SrugCtNd272E7fSfUdthlwH QwXqsfaTJN0mp5TcNoNrzVVUSSGIk6wCydCaVa4x2l5a609kVsPGX2jACnLZnuDy2/FlPW3Mp KkpM3h8oP+WY6r+Z0y/KSgN+M0xFBxDJryuO9VxSywI84lKWJePrO620a4qOQusaDl5H9qxjn 7XJPV3GOTJaQ8v4WzbwqlSIBRR9AQPMANuEfn+PzdAVc5zR7ZlzW0IuXDt8qEY1p/7kd5sT1M pX0DcRDrhfx6WQgtjbk3v5bf7jf+x0WPfI1dP7WpY4h/0sxmPzeAcCGW5WQgEmqAOUmc7WVZq iNona+ibVsTfKtstAS0YgGnokpHbu2Ni09i3Xh117su61ZZOnh2NfLd1qorhV4dydSwietfc1 1gZnVx4xKc3z1FgiFBaSJaT7jK3+nJsWSkKOluKDVl/4uNzFzdzCEKd+EyCauge5Bjvz6DAJR CsAE5U5XzEydXN8NJJ4wsq0A== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi Suhail, > I was imagining a version of TRAMP that was asynchronous. I understand > now that it isn't. FTR, some years ago (2018?) I tried to use Lisp threads with Tramp. This experiment failed. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 13:27:10 2024 Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 17:27:10 +0000 Received: from localhost ([127.0.0.1]:39536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soR7V-0006aY-WA for submit@debbugs.gnu.org; Wed, 11 Sep 2024 13:27:10 -0400 Received: from mail-qv1-f65.google.com ([209.85.219.65]:51705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soR7T-0006a8-TB for 73046@debbugs.gnu.org; Wed, 11 Sep 2024 13:27:08 -0400 Received: by mail-qv1-f65.google.com with SMTP id 6a1803df08f44-6c524b4f8b9so309416d6.3 for <73046@debbugs.gnu.org>; Wed, 11 Sep 2024 10:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726075555; x=1726680355; 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=7LwhL5K7HeoBfhFmXEp5jjhRuqlGRYEgfibbSksWLDI=; b=IfkDHTIZ7CyMKldkrln3yjalhoqGDkFQhybOlTaFASRupXuIuISpzUiV3w4ikpKpeu a9+HN8qTCxCW0V6hFkVpXzOIyA3qWwFQvqHaS2eOOOQOZFUKxpc5g++L12egMyQeuyez RtNC7Bkzn1PF607TQWLKBpShwBaU4YB8l0Jp5OIm+WNsCOeSxmokl9EhKts3EfIgRrD3 N8Hl7CicbRZ4K3R8tMGbGQKOK55xOy1EaEpY5NRXoh9UNIgxFAFC7kujdiUx2uypd5Mr aDqgzgA0Gt8zCprmNlD8eRFGgFZxX3PxDo8O8nGEeNY+Mn+R0hhbSzOwTGbV8PXEwsuK C6rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726075555; x=1726680355; 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=7LwhL5K7HeoBfhFmXEp5jjhRuqlGRYEgfibbSksWLDI=; b=ZWSa1ktue1XeDuWCUxvwexVmJQK/+QNYK6OxONAf0vIgVyDdLeKt1dDHDxmgmNiPDX 7oGki+ga8QcoacTELh1L4pTfQPazXNrWB7eR79gdtiKUWH3UBCLfqGRtvO8qJBPVd+FF tSSYc5y79GKuzAfQxOPsB2NMdAzoICLGu8/QcMewgHyBfygUo6Xc/3QwebxjSFBJT7HB cGtH8QeDOQGbWFexuYA89DAVyFzPWkV4WsEG+d3+OGPbW5fOxAMW3ZMDldgAHl7SNJZR kfw1Mn/n5vOnx6WLx45fC9TreXeG2mCeu0c4AdmezLg7iZDHJa4mT/FzC/A2OIoNDNPi nL+A== X-Forwarded-Encrypted: i=1; AJvYcCVCfy1nT4pOZ0DkWhN2Kj9i9+d/XcpIB0B+fpUfr1jJSQ5FzD5Xwd6+O/HYaUEAyaQ7VofrfQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxxYn58/Btr1C/rO2Clqav+RQgDuql3goX9okXpMPjkown+HZ20 FTVRxWJ+DAhpmM2BXsJGKQaFPDbt2XJWt0EY5VFbwQB8dvgCSUgcDFaNbSCV X-Google-Smtp-Source: AGHT+IFPlhhY5fzF3fndNGATnvjZSenC1pWlTIMioRuZFIYOQ246fHT7FbV0VnwaZ8loXwxuqK+QOw== X-Received: by 2002:a05:6214:5b0d:b0:6c3:508a:fec4 with SMTP id 6a1803df08f44-6c573590f83mr2512046d6.46.1726075554805; Wed, 11 Sep 2024 10:25:54 -0700 (PDT) Received: from gnus (bras-base-mtrlpq0776w-grc-23-65-94-70-53.dsl.bell.ca. [65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c53432e0efsm44328646d6.11.2024.09.11.10.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 10:25:54 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87a5gedu1y.fsf@gmx.de> (Michael Albinus's message of "Wed, 11 Sep 2024 18:38:49 +0200") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87plpb6luu.fsf@gmail.com> <868qvypfyh.fsf@gnu.org> <875xr2yx03.fsf@gmail.com> <87a5gedu1y.fsf@gmx.de> Date: Wed, 11 Sep 2024 13:25:53 -0400 Message-ID: <871q1qyue6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Michael Albinus writes: > FTR, some years ago (2018?) I tried to use Lisp threads with Tramp. This > experiment failed. OOC, the failure was from hard-to-debug edge cases while trying to get to feature-parity or something else? Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (suhailsingh247[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (suhailsingh247[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.65 listed in wl.mailspike.net] 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.219.65 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.65 listed in list.dnswl.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Michael Albinus writes: > FTR, some years ago (2018?) I tried to use Lisp threads with Tramp. This > experiment failed. OOC, the failure was from hard-to-debug edge cases while trying to get to feature-parity or something else? -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 12 07:49:18 2024 Received: (at 73046) by debbugs.gnu.org; 12 Sep 2024 11:49:18 +0000 Received: from localhost ([127.0.0.1]:40321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soiK6-0004oG-FO for submit@debbugs.gnu.org; Thu, 12 Sep 2024 07:49:18 -0400 Received: from mout.gmx.net ([212.227.17.20]:57193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soiK4-0004nz-9R for 73046@debbugs.gnu.org; Thu, 12 Sep 2024 07:49:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726141738; x=1726746538; i=michael.albinus@gmx.de; bh=wrrzuPvnxcitR7DyMiOnaJz6p5UOuXNEA/M/667TbZw=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=rG0Utdi70AELbo0p21gGhBKZffbpkSlaYm7ARXLLSXTdlYwq1gM8wucFOIheKDOh tikCcZJ78myqmQd07RvagZDyK8NZg2yyQ/nLqBwqsPk+/G6PNCcO4eljyJGqUc+Ft ncUuW1Gi3+2WSnAN/4i97wKWB6iCLDxgTckFGqZZzXR22utk9HhB0+kTFgJ2x+RCP W4U/j61X3vCVP6sX8FSAepZ/CIC/WZQrn1pnZbALsoxpRwyTXVWApSipOvVJF/cw9 oGYoNMw3j0K/PEh1wx2n7GCIOTnUoQUwRMIHF6NmdOuXeMzNfuo0ajKusRVaOasTC Z2Xn1yJfavYyqnWDFw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MIMfc-1slQWk1i6O-00721E; Thu, 12 Sep 2024 13:48:58 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <871q1qyue6.fsf@gmail.com> (Suhail Singh's message of "Wed, 11 Sep 2024 13:25:53 -0400") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87plpb6luu.fsf@gmail.com> <868qvypfyh.fsf@gnu.org> <875xr2yx03.fsf@gmail.com> <87a5gedu1y.fsf@gmx.de> <871q1qyue6.fsf@gmail.com> Date: Thu, 12 Sep 2024 13:48:54 +0200 Message-ID: <87r09pcct5.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:9jppUZIOVFE1ry8hPnRsStWU6YOdR2mtC3um/RxXVuEmjlxjm2w A5KSUQiNx98aRvbLzZqCVivvnOPAwRU4mDbueUse2+9IB/PgzNv6nqNH2ssbrdZjE3Zp1rz /WUu6LdkfIGndvnQtlfSHfrYaW1pZVM6G2YVFZ1J/MNfcveh0ecH4OjOZ4E0Ht+A2atSb4V RWQyHnQEDrXJOj5OeF26w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:itTxk+cO3Yg=;nTvIquF+h3dzgTqFCuzET2i8iGa InUcK8zWGhBQ5BuqVnv0lIinaLduQpziSY398SaeI/7vKT9obY7wh5U35ZjyWMuZ5RAZQLbc8 VXIu/H/w411VbfaiOgDMXU4Mm8vXxw/3S7wrkYhU0KIX1WRBvK7ZlphKo1WIQzF0XBWvp5TAN CX3ssYKvItust6k/GpNxhlkCnmgxc56CRvnCNUZN1F4vxtbt15Y2gYSsLStQJfo8q+68CoOyb mRZRJ6IaKwu8Wf2CGVTGH9Oboz0ew7crCqZ8f69eHQmKrCsVUdYEbncbPDtjjZDKcOBapDM2J eh2+an/AslynNahcHIYrSVPExDiqecSmCn9i1H1am1SbgMmJXk7dKAuTqUYWM9FFOw2ziMwk8 D2FeYpRhzfUmSKT/DfpO0aIi30HIH6TXX6oKliGAILlKQO9YCRVXFEOpFM+Hc16AEJqrGi8QR 1nfC+t/VY2nJ8+hUC32kPMofsVGIkPNKjS35/abyHzPBbQ5ZbG9NiqfZ4VJ1sr43ZgoJwmlph WxCQWdsCn7lHJNfLnuFaXTDbcNbHxfPeqMZjAjxYO7oOhpukFQKdXb4kHm67leChpR8EQgq6u 7u/X8sTAW1ut/H8pfXrUDPXj8V0BY73zr/zTwYSj2b5U9IhsK3e4QvNoev6D2xDALkBkeRCl8 RNmzogFqMsvqgxy/KJbOCDJs+vYVho3Efy38Ajh7BYIprLbwEVyvJJzZzTxJtsI6WSln9y5Dw IixSM0x086Xfqss6N6COA8UaGPh8Szp7+oYW28xnZ9PfTUNy3FJllxA0aIRJdTromKwHcUMgt akgjWTVnuF4Z6HbLUrrg2NeA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi Suhail, >> FTR, some years ago (2018?) I tried to use Lisp threads with Tramp. This >> experiment failed. > > OOC, the failure was from hard-to-debug edge cases while trying to get > to feature-parity or something else? IIRC, the major problem were interactive dialogues. See bug#32426 and bug#25214. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 11:47:43 2024 Received: (at 73046) by debbugs.gnu.org; 13 Sep 2024 15:47:43 +0000 Received: from localhost ([127.0.0.1]:44068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp8WM-00079J-LX for submit@debbugs.gnu.org; Fri, 13 Sep 2024 11:47:42 -0400 Received: from mout.gmx.net ([212.227.17.21]:45787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp8WK-000793-26 for 73046@debbugs.gnu.org; Fri, 13 Sep 2024 11:47:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726242441; x=1726847241; i=michael.albinus@gmx.de; bh=JJ9ejplH+f+icV4f0oPsy/3BLm17aClRN5WzEF5p4Fg=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=TPmTstAcKFFH/LFHZh186Y8t3brrsnIZwrR9a5cawnNBqe2d+w2yGybqNaMpPetS TFkA25jf6VM3hOS4T5viRXNr8rZgTK/Gh9nEiTPZpYbXcZWQK/HdOUJYz1Rzqjksm IT+4YSjnvJzjzySCWVgPdUBXWcZQBlMg/26WRef58KG1rAPzUK4OOFl8DvHuPKQJE NMyZucUiA7zFQbZKEFWjNoZZpB94a5PP4QpFn7RjHWfmG8PVvWLIazt0k9MoOsa2C H7JKmmBFElgx9cjPRJLN8TXlaFxCWACOZeYteEv8GGgTf1At9ZSCIFR6d06Bc4oWY 4NVMBxrRQ2oKIgUnJg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MiacR-1sKB5T36VL-00fkev; Fri, 13 Sep 2024 17:47:20 +0200 From: Michael Albinus To: Jake Nelson Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87v7yz1sw8.fsf@rutgers.edu> (Jake Nelson's message of "Fri, 13 Sep 2024 11:21:27 -0400") References: <87v7yz1sw8.fsf@rutgers.edu> Date: Fri, 13 Sep 2024 17:47:16 +0200 Message-ID: <87r09nwo6z.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:gLWy4NCYbQ1zbpI5xJeplOQ6/7aUBIkcWzePUrkqbORvyfH2/ET 0Ggqg6s4ZLe4V8G47fszjq5mEUICjRfOK+wDxB+ZaSPh/EkhdbRpGIzEvxcF29MCEFfvrSJ 3mgRl91efVaz53KcVg3fK7wuctlAMglF6uC7CocryNLqfPM84VGtXN8tjn4FjV9DdFUE5CV yjymykb0FxrLLyNsHRQYw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:rrDXbdkBx8Q=;ARzAvbZWbJWnFlemFk4SORbVwZH innCkf4+M5iA5xdWBQ6qH1YrhsvBl7gpUw8syzGrZ+uuATeE7La0KT9QTQ65I5nyJLNaaf26L qvTLf8/Rz89jiBK2jC1ffmm9u/aX1NDi+EWdW6stbxWkmyOpF+vv9K16/ITleRVZ3UiezP45+ vcYoD8Fh+cVBJEVHQA0ZZ0ABtFJVNIhrLcagDnZXEaay2RoVvIpTUN2i9s9KMcKBTK1Ap4Vi5 66Pq20O7DA93Ui7m6HRAF21Lz8yHCywP8xBnTks1rNP0gNPX3O3iG2hFFyh5XLxohVRD2QIYK Y9l6f2h+JMP0jQUs6Fga1VS22jblJ5b7Ta0NR7uYJDUCNYyi7moMvOZkMnCjP5fDbv4libSWO O6GhWcc1UIPLdIAAyD+IcpSsP8A+kMaZjvNGgPlFJ1JkvsoNt+jox96BtVIitfc3+fj48UI2X SLBkW0BMwQJkVJDvLrT513o3BuomPWRuW+PakaBjU3RJvlZekkPqxAI0fUdnvQHQ3715iPSJW Hf419jKvJbg3Jmd0a8PWdAPdrmvno6Vxv+0UD6JHp44QFwG9dptN10Vgfyh0cRGgwruR4PMLK A8QZ9wE1D8r7iNLsTOPUXdIRFT/PTdoKYTbpxl9Ag3jTnQ5Uqzh9FMKIkH9LXbSgSQYISUqih F0y3nkvcsvH5zAic01bjTpkEQzlcKFLmdkb4C+anhEFEnoAD6aNZLvw/LXPdZJTSsBfH/Z2Rs 3cR6rTO9WyEBqdE4991gD1Lm/6UDHz837mQHkoput6pWYm3lr8YsQt7KhOvmbKNYy3++IdUBa zRip3EaTfARTCBWp6/QMMFFQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Jake Nelson writes: Hi Jake, > I had to revert 652a8a0838b38a6eab85c55fc61cedd1c61ef20f > > I could load a remote file with via tramp, but attempting to edit the > file spiked to 100% cpu usage and I had to C-g to recover. Could you, pls, reenable 652a8a0838b38a6eab85c55fc61cedd1c61ef20f temporarily? Then recompile Emacs, and run --8<---------------cut here---------------start------------->8--- # emacs -Q -l tramp --eval '(setq tramp-verbose 10)' /ssh:some-host:/etc/somedir/file.yaml --8<---------------cut here---------------end--------------->8--- Try to edit the file. When the problem appears, return control by C-g. Show the resulting *debug tramp/ssh some-host* buffer. Likely, it is large; you could send it to me directly. > Thanks, > Jake Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 13 19:19:06 2024 Received: (at 73046) by debbugs.gnu.org; 13 Sep 2024 23:19:06 +0000 Received: from localhost ([127.0.0.1]:44428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spFZC-00006B-4W for submit@debbugs.gnu.org; Fri, 13 Sep 2024 19:19:06 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:54472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spFZ9-00005f-P1 for 73046@debbugs.gnu.org; Fri, 13 Sep 2024 19:19:04 -0400 Received: by mail-qk1-f193.google.com with SMTP id af79cd13be357-7a99a46af10so145783885a.0 for <73046@debbugs.gnu.org>; Fri, 13 Sep 2024 16:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726269468; x=1726874268; 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=k8eqoF27XR/Wpkbg4bHsIOKzo/7+VFwMLC537iOwYLE=; b=TmUpAbZcQv28BvfnaxlBeLgOXdArhnrb8GIe0Ai4Bz9Sww7WMSf8Zlq4HneKwnZooB OItNUasdQeR3ioXnia2gxw09D5L6GRFnHlkDHG6GnRk3OnPdqvnxBtkAtA5lSAjnDu5+ 8YyfPiUXjuHuPt9/ZbWNsCU+yNugVt0ECqIAvWXhVC221GrM8jb2Ya8vfiB8niUf3pwK fhMovnG8K4WYDHE6ZBwPCcAFdJ8Vx8U/+e5zeGucuqgF1+dF+V861j3Y9Ah+FLHiIeww CpQ2u0g07HbcaP3+BC2GR3wC8lu3BsaTu3XsXfAw5W14tits1VDYqIfVpMhkjeSM33Z8 /mJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726269468; x=1726874268; 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=k8eqoF27XR/Wpkbg4bHsIOKzo/7+VFwMLC537iOwYLE=; b=Oznis/mj+rwlCBCSfRYXzM0ZPidTfAVEZ3fR4q6dJS0Zd5zbTmXZCzol0iQ4ch1n+U CWSSpkWXBCaTYaph+WquKRwqDuiQpb6lCG+zctELjIRdy8wwPImRdjKMPg785x/NoX3F bO4atDEWKSLgDOAgNYEQDSI2m9Q7C8e3T6xNggyCdOy9LGaDTUU8BGw1AvmDAZaFMff3 aW0YZQuHUjv2yGys6ppMLdUzwtwLd/xVpgpdv9zYaw3b/Y2SfhS7K/5mCagrioumcKq1 WoqTm5VkeSxdZhf31Lyi9FOCHxFGlXr9XhrecXXOZuvSc0qsZBV7DxX99Ay7LZTM5cUY kXgg== X-Forwarded-Encrypted: i=1; AJvYcCUtQv8zAFpB08hiUtXrS7nRQ5bpQFAOhs4b2hx6GuEruGamp3X04Ea34oTwmYUt4hf3UuLzfA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxSSSd6rAcfJvm0qxaKJn2Q7hcXMJonN2IyznKvg+oQr9e2Y+Ui VFsC88o7E2e6rlu8pSt+jOLjdW8D1TwNcY6qKShZK+EaA+mTP0LhfQAET0UR X-Google-Smtp-Source: AGHT+IEgUV+dsojCRHkEK167LONnvgJb0i+CVhg/TCh6J25eZXadRyhX1f98ImfR/zXee9y5fGiFow== X-Received: by 2002:a05:620a:298a:b0:79f:1eb:d76c with SMTP id af79cd13be357-7ab30da7658mr822211085a.43.1726269467841; Fri, 13 Sep 2024 16:17:47 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ab3eb62910sm11676185a.104.2024.09.13.16.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 16:17:47 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87r09sexp0.fsf@gmx.de> (Michael Albinus's message of "Tue, 10 Sep 2024 10:10:19 +0200") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> Date: Fri, 13 Sep 2024 19:17:36 -0400 Message-ID: <87cyl7rvn3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: > I've added (sit-for 0.005) in the loop calling > tramp-accept-process-output. It decreases the CPU load from 100% to > something between 45..50%, when waiting for a response from > remote. Pushed to master I tested this patch today atop TRAMP 2.7.1.2. Some findings: 1. If directory with symlinks on remote host with slow connection is opened CPU usage is much less than 100%. That's the good news. However, there are a couple of caveats. 2. If we are in parent directory, and soon after pressing RET we invoke M-x we don't see the minibuffer prompt till after the offending directory has finished font-locking. 3. If after invoking M-x we immediately start typing, the keyboard input is registered, however, it doesn't display in the minibuffer till after the offending directory has finished font-locking. Additionally, doing so invariably results in 100% CPU usage for the duration of the font-locking. Sometimes invoking M-x alone results in CPU usage going back up to 100% (while font-locking is still being done). Thoughts? -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 02:24:28 2024 Received: (at 73046) by debbugs.gnu.org; 14 Sep 2024 06:24:28 +0000 Received: from localhost ([127.0.0.1]:44550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spMCq-00071d-6y for submit@debbugs.gnu.org; Sat, 14 Sep 2024 02:24:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spMCo-00071O-Ci for 73046@debbugs.gnu.org; Sat, 14 Sep 2024 02:24:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spMCY-0001yM-Ft; Sat, 14 Sep 2024 02:24:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/qGbD0bH+20hagpjztwXw1WCGC+CqUiboJtAHYQEoOE=; b=auNqcoBOQOIl 5kwLtxfKUu9kQPQ9Mvu/zN87XfHx9dFFuljR3c4mvhAykWHA9dQeyXTle/wVSdJ3l+fUDNF8c9R1m RNDYfV5qmgnzt8ZmONMdz7N0hMZEzYvEPwFHEOiIOZockU6SUrtss2kXvRWteiwuh+XaKe6kEsT/o 3VbaxB1P52kaYx+nNiL0/jLCXHDMusNqj6Ag90OW6KguzauPaFWWaW79GTUEzrDmIUUTdY0by1DZp gfuSQ/Y4aBGWEKdXg1sonqjsav9BNLTZl09OmCSCxSDUlDBXKNV9TALmsxZAVmJYzYUb/PRYoFfUX JPPx0u3mLrAPZUgyhNGXFw==; Date: Sat, 14 Sep 2024 09:24:07 +0300 Message-Id: <86y13uiwhk.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <87cyl7rvn3.fsf@gmail.com> (message from Suhail Singh on Fri, 13 Sep 2024 19:17:36 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: Eli Zaretskii , suhailsingh247@gmail.com, > 73046@debbugs.gnu.org > Date: Fri, 13 Sep 2024 19:17:36 -0400 > > Michael Albinus writes: > > > I've added (sit-for 0.005) in the loop calling > > tramp-accept-process-output. It decreases the CPU load from 100% to > > something between 45..50%, when waiting for a response from > > remote. Pushed to master > > I tested this patch today atop TRAMP 2.7.1.2. Some findings: > > 1. If directory with symlinks on remote host with slow connection is > opened CPU usage is much less than 100%. That's the good news. > However, there are a couple of caveats. > > 2. If we are in parent directory, and soon after pressing RET we invoke > M-x we don't see the minibuffer prompt till after the offending > directory has finished font-locking. > > 3. If after invoking M-x we immediately start typing, the keyboard input > is registered, however, it doesn't display in the minibuffer till > after the offending directory has finished font-locking. > Additionally, doing so invariably results in 100% CPU usage for the > duration of the font-locking. Sometimes invoking M-x alone results > in CPU usage going back up to 100% (while font-locking is still being > done). > > Thoughts? Are 2 and 3 new with this patch, or were they present in the previous code as well? And what do you expect to happen when you press M-x while Emacs is still busy performing your previous command? Having the visual response delayed until the previous command finishes is normal Emacs behavior, being a single-threaded program which executes commands one by one in the same thread. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 03:07:53 2024 Received: (at 73046) by debbugs.gnu.org; 14 Sep 2024 07:07:53 +0000 Received: from localhost ([127.0.0.1]:44600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spMsr-0001Bk-1m for submit@debbugs.gnu.org; Sat, 14 Sep 2024 03:07:53 -0400 Received: from mout.gmx.net ([212.227.17.20]:35437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spMso-0001BR-Gl for 73046@debbugs.gnu.org; Sat, 14 Sep 2024 03:07:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726297653; x=1726902453; i=michael.albinus@gmx.de; bh=uEa55NY+m93/hi18niW5BaFGE6uo50AZh45bTMMBK4c=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=MG7aerzEv+z5Pj/8MPZIf17RHJppEIFtniIm7fP1M+JgVVFz3XJQgP69+NwZKaKn qTvOsSuOkYCeugftsSHgGj4rqr2M+bvnuBfgqIVZd0pfb8G605xgueX9TWh/d/GNZ xfLyDTWbbrBzlcS1JawdQ+4CoB3nlyK3waGjzKaKUh6PDFGB6b573m9Nf7zxFNsHm 4DDcqt4XmfpRKLD77a8b0RpeCegOAkzd/3Yj/u8fdzAHuvdSWVu+UfvPX6oj6tJVR LZyafwuOeebPSr/vS02Q7cFMTjHWEsyaThOfuPbRQ+DH2ZVmsk3tvTcKlW0fREQDR R4b3dRbWYj5JduzDmg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQe5u-1sbfF52NT4-00NfMZ; Sat, 14 Sep 2024 09:07:33 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87cyl7rvn3.fsf@gmail.com> (Suhail Singh's message of "Fri, 13 Sep 2024 19:17:36 -0400") 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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> Date: Sat, 14 Sep 2024 09:07:29 +0200 Message-ID: <87bk0qww5q.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:++91BJlCLzzkIsoMRpGsBGowj6iNG3YfqEQlrSSP5+VzpefJu5r bZ0I4R0e0sjQlvS9h+n0Brc34chRTRbCy2Z4alLJkodIUF2BhVfkL3soff+UvIOlXcN3VGv jySwIxXMtz3w0KSqFktmomc7a6tC/Vc7cAuax+P7QzU82E1o2uwouULknHVRg/obtwUrcBX UVxdd77HHMYMPM9VUDbmQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:4axX4k6eHas=;3u5O8mEfgbf2aHpWKwu8y9SESi9 ncpg2GP1Jw7r7BVFPb0oMfr+2KhzAJRGcq1BIJcfqTLdXdJ0LPWqMlq/AYCUadjVqgi6rawIv 4rw8VuQGwJdJkLEH0ze3Ww9LF44EfAXNlvHstmvQpyHt1yH4syrmByRznqM3ezc57bj7B5cBv /PtaFOLQS16hdLZN8Q5EGiep//1kQ+j1x75C4eVFk0z+/icRYJfLsEhlrWaRYFi+JqsuQ6en7 UibDr5RbWLU3SuTACoUTgS6CbneN4BZ6Q377vjkfAh0o6lSTRPX3UtfhdqHTMoekliyW444Fd e+tPA8JUNFRcwZWR22vk++McCZcGgyY4B7XZAlukLEvacl5rMUswMdB9opWb1FBvgqQLqPyGh GOpSlynW6UW9cyK4qzcj8tM5e71wMeKTaB/fus07zcMRD6nt/91Kxuhiqc/rSIzR+G8grnKUO BuC4Rwr71D9W/PksNXCoD3I/maK5nbgvqazlVnJFkg9tiVuYAu2CFVoaiznGGZPRZtLTmH4vt x6dyo+F22ZXfLL7+mow6j/3g13JJ7iVFDzV7xAfLWczmhIbo9D3NGwuNGyUtwjZaQVExrUz+9 HdwvEDcoYxICwKE8JwQwWuHc+R1heK/UYn9eF/OWzXaSvlsfV+eL6eapFjdz01UBKihQTfetm JVN4y0JgHUfZ3ABwOIocREyYhp4ugft7baaNRv+1hAgfnSApNpKmo6pXp0tWCozKFsGn22NQb 0RUcypW53IGN7+4hg0ulQp3RhYYnRGb4S1IHMRmRXYNbEYA3j6B8HaH57h+hXKD5o7RKC4xTJ p4MjE9Vx3d8ZBaQBMPOvbHAw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi Suhail, >> I've added (sit-for 0.005) in the loop calling >> tramp-accept-process-output. It decreases the CPU load from 100% to >> something between 45..50%, when waiting for a response from >> remote. Pushed to master > > I tested this patch today atop TRAMP 2.7.1.2. Some findings: > > 1. If directory with symlinks on remote host with slow connection is > opened CPU usage is much less than 100%. That's the good news. > However, there are a couple of caveats. But there is also the message from Jake Nelson, reporting problems with the (sit-for ...) clause. Yesterday, I ran some regression tests. When (sit-for ...) is activated, there are serious performance degadations. So I've deactivated it in master; it must be revised more carefully before activating it, again. > > 2. If we are in parent directory, and soon after pressing RET we invoke > M-x we don't see the minibuffer prompt till after the offending > directory has finished font-locking. > > 3. If after invoking M-x we immediately start typing, the keyboard input > is registered, however, it doesn't display in the minibuffer till > after the offending directory has finished font-locking. > Additionally, doing so invariably results in 100% CPU usage for the > duration of the font-locking. Sometimes invoking M-x alone results > in CPU usage going back up to 100% (while font-locking is still being > done). > > Thoughts? No. Yesterday evening, my doctor started a new torture with me. This will last about a week; I fear I cannot work during that time. Sorry. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 10:26:44 2024 Received: (at 73046) by debbugs.gnu.org; 14 Sep 2024 14:26:44 +0000 Received: from localhost ([127.0.0.1]:47536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTjY-0001om-1I for submit@debbugs.gnu.org; Sat, 14 Sep 2024 10:26:44 -0400 Received: from mail-qv1-f68.google.com ([209.85.219.68]:51423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTjW-0001oU-9g for 73046@debbugs.gnu.org; Sat, 14 Sep 2024 10:26:43 -0400 Received: by mail-qv1-f68.google.com with SMTP id 6a1803df08f44-6c359c1a2fdso17327946d6.2 for <73046@debbugs.gnu.org>; Sat, 14 Sep 2024 07:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726323925; x=1726928725; 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=reqR/+9xaf9hr/mAX1dQNtGESU3ohPfZhTV/jvY641g=; b=SpAIMkPvwoHT/qFhcyQB57iR7HkpRbUqtLGONlH3kO03nNpHvHyBCwnJh/h70319/j 79FovoEe8XBS0903+Hey9Yz06owwF3YMdZuu2/WvVy6oEMeU5nSbaMvDOgY0+Ak4tytM uryRDwYImw43u4BsqLU+NFCx53MBw99sw7imib1ADwMCMGIO06YXSacsnJoeU2CvqiCz gmLjLehvgUO411t6nKWz+ahtClrRt34aFACpBJs8MORLi3VPJyaJKkJodi0F1R3rMAu3 7+gTOBqU+N+uxaEWuvA5gYei7FlTi7I1OMXcG8jNwfloQZP3psffU7UfXFJy9CTsktDA 5lPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726323925; x=1726928725; 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=reqR/+9xaf9hr/mAX1dQNtGESU3ohPfZhTV/jvY641g=; b=vJluSVU5olxd2Ovc0ndb24PFwmEDvZivzhKvrjE2tEeQIG/VmOmxvzQo9/jHhAQn1K VmOlKfCQL1iJymprylHAd8a8pNAq6ucUbaEtfbbAL0K2Unp3+NlYVZ+eJkubUfQ8IPCH B/E46dt+Z/oHId/1m93MZYHdlkdZ7TaCFo6/xzG6XmTj3Gi7NrfCVC37+r3/uIjGztb1 vO+6n+v0KJ6YWcozy0RfbKJX/VDN0A0IjXo6xaHFGLPOzJjj+mCELCFcjddgjOa1KOIB Dd+J/j8r8dw2ORnEVtZUmcoKjAP+CY9BLFmO39g5P8ORsMTqFimBEZRrBUhswZTydVS2 PjzQ== X-Forwarded-Encrypted: i=1; AJvYcCW9DmkoGnbWG7B2IkDsEjKKAygVHy1vLHZSqg33pUrOMM53AFK0TFnRYlQzw9auvDAXYUOiPw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwGT8UVQ3FjQr1GgGTu3fUbtuUlx91feV0iQc+QA2K3oaN4NBqm O5Txn9qr3g6atARCBnU0grK5GBXL0KYNbLIn4KWEo59WJrGen8Cv5cyfiqPx X-Google-Smtp-Source: AGHT+IEE80nbPwRla7688OC5P6stsX5si8S+0BNjsWQTFENtYS+NaTSinG0XoTUE6f5Lx6iSWZ/3fA== X-Received: by 2002:a0c:f40e:0:b0:6c3:5b9e:699d with SMTP id 6a1803df08f44-6c57def3401mr89836536d6.2.1726323925366; Sat, 14 Sep 2024 07:25:25 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c58c6279c8sm7413836d6.18.2024.09.14.07.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Sep 2024 07:25:24 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86y13uiwhk.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Sep 2024 09:24:07 +0300") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> Date: Sat, 14 Sep 2024 10:25:13 -0400 Message-ID: <877cbe48ja.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: >> 2. If we are in parent directory, and soon after pressing RET we invoke >> M-x we don't see the minibuffer prompt till after the offending >> directory has finished font-locking. >> >> 3. If after invoking M-x we immediately start typing, the keyboard input >> is registered, however, it doesn't display in the minibuffer till >> after the offending directory has finished font-locking. >> Additionally, doing so invariably results in 100% CPU usage for the >> duration of the font-locking. Sometimes invoking M-x alone results >> in CPU usage going back up to 100% (while font-locking is still being >> done). >> >> Thoughts? > > Are 2 and 3 new with this patch, or were they present in the previous > code as well? Present prior to the patch as well. > And what do you expect to happen when you press M-x while Emacs is > still busy performing your previous command? I did not have any expectations wrt 2. I knew that it was possible that 2 was simply a limitation of the single-threaded reality of the current implementation. However, it wasn't clear (till now) whether that was necessarily the case. I did not expect 3 to happen. I.e., wrt 3 my expectation was that invoking M-x and typing doesn't result in a noticable increase in CPU usage for the duration of the font-locking. > Having the visual response delayed until the previous command finishes > is normal Emacs behavior, being a single-threaded program which > executes commands one by one in the same thread. Understood. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 10:41:17 2024 Received: (at 73046) by debbugs.gnu.org; 14 Sep 2024 14:41:17 +0000 Received: from localhost ([127.0.0.1]:47563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTxc-0002es-QU for submit@debbugs.gnu.org; Sat, 14 Sep 2024 10:41:17 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:52495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTxa-0002eZ-3d for 73046@debbugs.gnu.org; Sat, 14 Sep 2024 10:41:15 -0400 Received: by mail-qk1-f194.google.com with SMTP id af79cd13be357-7a99e4417c3so163747785a.1 for <73046@debbugs.gnu.org>; Sat, 14 Sep 2024 07:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726324797; x=1726929597; 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=0G+Ib5LMioKmGp1lRfPtoqbTOKWb6Ai4nr58FliLmNA=; b=Av+WCS4bU7FRfI/ak/Qn0xFYHEwLk/VLL2gSHgb0gEWFjBePS1rslQzhMiST7zSiwt DDlbTiMtYA0ovScFC5hUJUh0wGrCouXMy7QKf6c6VpQUS8E1mcPn7DDF6uAyalp5cQjN Ys5MYIlQjaUkvnuU+cZmiERsHe6GIIAOa///A6R0w1/ThC6gS8EH2WYqScI6PFFKShAY mDBH89b5mnBs0AzqypbU51qjGyRiKZ7iSWT+zfjxkBBwJu7aPtZjal8kbgFAGK+ECqMZ Jn+YhK+mJhKtv4DcSfPvVZBnzB47fk2VP/tXtM6kqaKIjicgriL5GbRlI5s/sIA7/uEF Cokg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726324797; x=1726929597; 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=0G+Ib5LMioKmGp1lRfPtoqbTOKWb6Ai4nr58FliLmNA=; b=UmJPTYK+ZqYn5gStFWHGXRsU0Em8kmvHNsp/UwPVSPc+jPsbiyLYZHDqBXyTJ3BNSc R/zyChmLoWG5w0Bi7iOBWV93lRm3ZsNG/qGGJqKtBkMBem9Ti7+O0x/LrlU+KX/bjwsD 600LVstHZ37d8TJW3wz0HOvrhMoJ/K+xyxIJQWjZkZr0KaNw+7caaX8IGJLy+AU/357x 5E+YYrO6Xsex95oPP/+QGU9BV2V/JskurehUf89Px4CPZcDxpa1BuTN40OKf4asLPQ8K B1ki7Jbup1WYB+0aQh4vIkAFoSwaGjEafKR0O/yd0MwapU0n6WB9+SPoz7Pud8P1inpM CsjQ== X-Forwarded-Encrypted: i=1; AJvYcCU9CE+3hGd8VdyWrETAYZx6h9Cj1I3CoJZk3Fe3aZ5bKq09kyhQR1PHFkFsCPoHIxjbYRvq7g==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz3IJLFvz0Uu9lWAAYnpJayPJLm95vkSYBbdy/ZlZvUZz5R/vJc c5W68bQDpqdRqDTFzETTkYTpfVJr1ow5JIB1D81ihxgrIi40a37TnFXjEnMA X-Google-Smtp-Source: AGHT+IFoHEuScZ054Fhutd2RQEVgQ0iJ7rkvIf9R1JM+O3ufRybhujOtlEzQzQlUCLZEpxTxmTONoQ== X-Received: by 2002:a05:620a:1915:b0:7a9:b9ae:df5b with SMTP id af79cd13be357-7ab30d2403fmr1192061485a.19.1726324797156; Sat, 14 Sep 2024 07:39:57 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c58c7d6282sm7459586d6.139.2024.09.14.07.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Sep 2024 07:39:56 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87bk0qww5q.fsf@gmx.de> (Michael Albinus's message of "Sat, 14 Sep 2024 09:07:29 +0200") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <87bk0qww5q.fsf@gmx.de> Date: Sat, 14 Sep 2024 10:39:45 -0400 Message-ID: <871q1m47v2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Michael Albinus writes: >> I tested this patch today atop TRAMP 2.7.1.2. Some findings: >> >> 1. If directory with symlinks on remote host with slow connection is >> opened CPU usage is much less than 100%. That's the good n [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (suhailsingh247[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (suhailsingh247[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.194 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.194 listed in list.dnswl.org] 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.222.194 listed in bl.score.senderscore.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Michael Albinus writes: >> I tested this patch today atop TRAMP 2.7.1.2. Some findings: >> >> 1. If directory with symlinks on remote host with slow connection is >> opened CPU usage is much less than 100%. That's the good news. >> However, there are a couple of caveats. > > But there is also the message from Jake Nelson, reporting problems with > the (sit-for ...) clause. Could you please share the reference to that message (at your convenience)? > Yesterday, I ran some regression tests. When (sit-for ...) is activated, > there are serious performance degadations. So I've deactivated it in > master; it must be revised more carefully before activating it, again. That's my impression as well. >> 2. If we are in parent directory, and soon after pressing RET we invoke >> M-x we don't see the minibuffer prompt till after the offending >> directory has finished font-locking. >> >> 3. If after invoking M-x we immediately start typing, the keyboard input >> is registered, however, it doesn't display in the minibuffer till >> after the offending directory has finished font-locking. >> Additionally, doing so invariably results in 100% CPU usage for the >> duration of the font-locking. Sometimes invoking M-x alone results >> in CPU usage going back up to 100% (while font-locking is still being >> done). >> >> Thoughts? > > No. Yesterday evening, my doctor started a new torture with me. This > will last about a week; I fear I cannot work during that time. Sorry. I hope it all goes well; get well soon! Please take your time on this. The `dired-font-lock-keywords' tweak effectively reduces the severity of the issue. When you do have an updated patch, I'll be happy to run some tests as needed. Regards, -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 10:43:20 2024 Received: (at 73046) by debbugs.gnu.org; 14 Sep 2024 14:43:20 +0000 Received: from localhost ([127.0.0.1]:47571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTzb-0002iw-PR for submit@debbugs.gnu.org; Sat, 14 Sep 2024 10:43:20 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:52559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spTzZ-0002ij-WD for 73046@debbugs.gnu.org; Sat, 14 Sep 2024 10:43:18 -0400 Received: by mail-qk1-f195.google.com with SMTP id af79cd13be357-7a99e4417c3so163856285a.1 for <73046@debbugs.gnu.org>; Sat, 14 Sep 2024 07:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726324921; x=1726929721; 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=rjTDY/9BC/kDp/U0b6rou7ePwv0Tu0zDX8TOm6LP5OA=; b=Wf3ylENhIr6Uyg0Wp+NmQENzIMSFGU5AVngvF0e/qVfPEzvNql3vgLp6+4gO8JQI8L xgGb1VQvj9V0mbEZjLvJ1jeBOK94XYoS3whirXCAvgkFMnT8C16j94Yut5gsLbJt8pdG 2jtZ0pa17Nh2XbmCFl3BmHJuA4P4FUslVdMI/f5haHajcges75dw2OE/fTlDvHOJNWjh Qwj9vsyviaOu+KD0NcJIhSphtcgp0tRJn9SOmuzRRwQBmxUnRY7XCLc8OcIgKdwAbxkq hIdCj0C2JpJSpxpYGpoVxHNBW/2iTuHSth4gQTjkOSCp+/bKC8E4A082aAl+goXDasww ySiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726324921; x=1726929721; 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=rjTDY/9BC/kDp/U0b6rou7ePwv0Tu0zDX8TOm6LP5OA=; b=nw47bw6+OX2BgMKo1aL+Pg/YIxOJohp8QCOhQ2uvpbCFtqzKPxlSniGWRCrkNaM6rv Sko0Z6add9ku0nvwOt3bGFXRa89GRxmlAMSr1MJt/C3/n7aX8kotALT36M12DglrZ1rM T5+L8eC9LGi3EbMZY4yDYviH4jEPIu5ZfELwmwQNT8QIEQVupcGjtGAJFPmM32VNwRNH nFcmDZe4r3FzvaIHgn0KjtevTQNtVcF7cmPjK1LbdFFcExTCxDES/Z2fvtTwbjWItnpr jA6OSnOyY9ydizsOUcZk9ezK0VCejeZXz2zGAzjSbU302pnKIJU24QwOtKbCS4W4wPDl H18Q== X-Forwarded-Encrypted: i=1; AJvYcCUxNydj8XyOfqS2g6nuzVpnMbqHzdjXOeLpTcsk01J0J2O87fs6FJmhV7cNh/ssnaOiLgBrqg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzz5RML3vZxHGumCApWcQlcY95wV56ndBQu1nhuh8TD0CcpPDDw 6zPNMPcvdb2hydQhYX1C8ZUiOMQgTDi+n6Dr3TwPSel7VFgSbLu7SWH6chgZ X-Google-Smtp-Source: AGHT+IEhEALI4oOtGRaD90+8iqDviHFXlE+W0B41SuTs/tUgoIf3j1RKZlSZbHvMhYr5soswK204Tg== X-Received: by 2002:a05:620a:4103:b0:7a9:d0ec:2d9d with SMTP id af79cd13be357-7ab30d23de5mr986155585a.15.1726324921635; Sat, 14 Sep 2024 07:42:01 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ab3eb55930sm74179685a.83.2024.09.14.07.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Sep 2024 07:42:01 -0700 (PDT) From: Suhail Singh To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <877cbe48ja.fsf@gmail.com> (Suhail Singh's message of "Sat, 14 Sep 2024 10:25:13 -0400") References: <87o75241qh.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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> Date: Sat, 14 Sep 2024 10:41:49 -0400 Message-ID: <87wmje2t76.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , michael.albinus@gmx.de, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Suhail Singh writes: >>> 2. If we are in parent directory, and soon after pressing RET we invoke >>> M-x we don't see the minibuffer prompt till after the offending >>> directory has finished font-locking. >>> >>> 3. If after invoking M-x we immediately start typing, the keyboard input >>> is registered, however, it doesn't display in the minibuffer till >>> after the offending directory has finished font-locking. >>> Additionally, doing so invariably results in 100% CPU usage for the >>> duration of the font-locking. Sometimes invoking M-x alone results >>> in CPU usage going back up to 100% (while font-locking is still being >>> done). >>> >>> Thoughts? >> >> Are 2 and 3 new with this patch, or were they present in the previous >> code as well? > > Present prior to the patch as well. To be more accurate, 2 was present prior to the patch. 3 was unobservable, because prior to the patch CPU usage was at 100% throughout (regardless of invoking M-x and typing some keys or not). -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 11:05:51 2024 Received: (at 73046) by debbugs.gnu.org; 14 Sep 2024 15:05:51 +0000 Received: from localhost ([127.0.0.1]:47605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spULP-000441-91 for submit@debbugs.gnu.org; Sat, 14 Sep 2024 11:05:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spULM-00043i-MY for 73046@debbugs.gnu.org; Sat, 14 Sep 2024 11:05:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spUJ0-0008Cd-9a; Sat, 14 Sep 2024 11:03:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=zdwsPGtKWrPqOWjVLoqA/VM9xQtEIFmIlxRcfx0a3CU=; b=SR2PuSrDn3OO k/qw6gzA0QeAHAvKILBzDq30Y9qRbvQr+nh6bRM/zEcB8CBJ1BJ+VWxfARuJopDSXofWTlt77RkYq /B0XIe7gUSgYhh4e3f2pi576DTkS/wt42LHDmn+vor/UWehpl0ZVmWEf7QfQvpotPh4//r/yHK3FP 3934P4aXwOVMWy/QNo187GzGGWPPCRUMgMbWfCPboFvZFD+dqmJ3b13shXOuUKnSlUF2HvbNiP8jl K5iAqWaDtDXDoSWm0RFm7lQuuwWLarBweiBm8R6meeXoy7X8ccZ8dLKMokYuQPfpcj9kzIkWaA7Rj zTRqhkNZvVL0Gua/X2UfQw==; Date: Sat, 14 Sep 2024 18:03:19 +0300 Message-Id: <86ed5mffbc.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <877cbe48ja.fsf@gmail.com> (message from Suhail Singh on Sat, 14 Sep 2024 10:25:13 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: Suhail Singh , michael.albinus@gmx.de, > 73046@debbugs.gnu.org > Date: Sat, 14 Sep 2024 10:25:13 -0400 > > Eli Zaretskii writes: > > >> 3. If after invoking M-x we immediately start typing, the keyboard input > >> is registered, however, it doesn't display in the minibuffer till > >> after the offending directory has finished font-locking. > >> Additionally, doing so invariably results in 100% CPU usage for the > >> duration of the font-locking. Sometimes invoking M-x alone results > >> in CPU usage going back up to 100% (while font-locking is still being > >> done). > >> > >> Thoughts? > > > > Are 2 and 3 new with this patch, or were they present in the previous > > code as well? > > Present prior to the patch as well. > > > And what do you expect to happen when you press M-x while Emacs is > > still busy performing your previous command? > > I did not have any expectations wrt 2. I knew that it was possible that > 2 was simply a limitation of the single-threaded reality of the current > implementation. However, it wasn't clear (till now) whether that was > necessarily the case. > > I did not expect 3 to happen. I.e., wrt 3 my expectation was that > invoking M-x and typing doesn't result in a noticable increase in CPU > usage for the duration of the font-locking. If 3 surprised you, then the reason is simple: sit-for returns immediately if any input is available, so typing effectively disables the wait. This could be countermanded by unconditional sleep, but AFAIU Michael is rethinking the whole issue, so we should wait for him to reach his conclusions. In any case, interrupting the wait when you type makes sense in general: it means Emacs is expected to respond sooner, which in most cases indeed means to stop waiting immediately. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 18:37:36 2024 Received: (at 73046) by debbugs.gnu.org; 14 Sep 2024 22:37:36 +0000 Received: from localhost ([127.0.0.1]:47929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spbOZ-0004Ro-Vx for submit@debbugs.gnu.org; Sat, 14 Sep 2024 18:37:36 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:45074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spbOX-0004Ra-U3 for 73046@debbugs.gnu.org; Sat, 14 Sep 2024 18:37:34 -0400 Received: by mail-qk1-f194.google.com with SMTP id af79cd13be357-7a9b049251eso261370885a.2 for <73046@debbugs.gnu.org>; Sat, 14 Sep 2024 15:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726353377; x=1726958177; 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=EGo7TQSuzCLGazNi2fiP7B61CQr1pXMP6R8k94uHbRo=; b=eXCi57d287fmogYri0a5fD/Z+pH1QmC3zCk4dd5/QuUjOOi06okUUs1op0NRfgfxWB /MDR+RqX9bVgVz29pPL+TmRCYPdMSAOgOJ5JsFJCQqzHg0eJvVAZKlJlDn8ErFfHFTYc u4LYhZGO7RZm8THLIVV39lccBXWkpan0QgbdR8bVTmefXaaeMo8QnHpgcNGUVbGVY+7c BQaYIZgpNKtm4g2w8+bDIKNCWF23xA4v4MZSkw0Zf3Wqjjo/pWKwJpvoy0qzxIwZp+Rz MJOA6oejaAxbK0T3W5PpF7YL/ZazqTCHRPJnPYYgkpcFNdfeXfhRUSgFR8c11JYePTDe ittw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726353377; x=1726958177; 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=EGo7TQSuzCLGazNi2fiP7B61CQr1pXMP6R8k94uHbRo=; b=H+2lJus6HEw8M0abLWJ9Fa0vLBv9vpZ4ggJRwsRfw+LDaK7uKMTGAiOmbig2UB3ZgS tRTaj2m0rIHFtt9SzpVvHzzKlttNAwri2zUBPbI3trWGmVKLuXpzMrT+BmhVS8bXstWN XUoRZ9+/csGirlbbLvdYsyhtymyxonE7PNUwBybC050fRqAuGQ0D9fdFejlLTY3q4MPd f6W5OSmzolT6bS0UCyfgSBH6JepbZ6ZoWnlgwIUVLc96JVKjVeIPtVRXxnyysg66ePhz vP/jAvTJKyi/wkdYYeT36iuWQmtqOQNAvRUCseIiaR2+zoHXMUKKUrK1GIGX1Y1JKh3X 5uWg== X-Forwarded-Encrypted: i=1; AJvYcCUAYuVtnn4V3Qnlv1Xxbl+T3ibrLYszt7/lmiwfL5qmwlOagPyZ3qYyHNFnhu2MHWfDPp30Jg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy7XoPFrScd335VJZtj1caN10jSW92gHkJnY9p2ZpG+eVnqPbJx /hli9Wieev7jNdT67Eg/4Dl8V+l0dJ8wfJ9Oy+ttwKl/4QEmswtKxYkKjYSf X-Google-Smtp-Source: AGHT+IENuRogvpIHVa3s+jv3STj6QH05ip1xmmtfr9cSNwEZfviQ3RCgJ6edenEakAjqfJ7GvcLZfw== X-Received: by 2002:a05:620a:4042:b0:79e:fc8c:dae3 with SMTP id af79cd13be357-7a9e5f91af3mr1770686885a.59.1726353376741; Sat, 14 Sep 2024 15:36:16 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ab3e9b3ed8sm107132485a.56.2024.09.14.15.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Sep 2024 15:36:15 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86ed5mffbc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Sep 2024 18:03:19 +0300") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> Date: Sat, 14 Sep 2024 18:36:04 -0400 Message-ID: <87ikuxq2wb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Eli Zaretskii writes: > If 3 surprised you, then the reason is simple: sit-for returns > immediately if any input is available, so typing effectively disables > the wait. Interesting. I didn't expect it to do so persistently (i.e., for subsequent iterations of the while loop in question). Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (suhailsingh247[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (suhailsingh247[at]gmail.com) 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.222.194 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.194 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.194 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Eli Zaretskii writes: > If 3 surprised you, then the reason is simple: sit-for returns > immediately if any input is available, so typing effectively disables > the wait. Interesting. I didn't expect it to do so persistently (i.e., for subsequent iterations of the while loop in question). > This could be countermanded by unconditional sleep, but AFAIU Michael > is rethinking the whole issue, so we should wait for him to reach his > conclusions. Agreed. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 01:55:56 2024 Received: (at 73046) by debbugs.gnu.org; 15 Sep 2024 05:55:56 +0000 Received: from localhost ([127.0.0.1]:48169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spiEm-0003z3-8f for submit@debbugs.gnu.org; Sun, 15 Sep 2024 01:55:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spiEi-0003yg-2O for 73046@debbugs.gnu.org; Sun, 15 Sep 2024 01:55:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spiEQ-0004UB-NH; Sun, 15 Sep 2024 01:55:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Nbf6mfvVLXArj5Fnl3pYcjtDNeIIyFAW3adSZBOP3LU=; b=bKDT7WOoEFep GqFaeX3USrlIbvqLr11K8byRs78QlsN84eDnMcq74PpxI4S27eWOpJfn3w3tLnF5U494XknJQUd0J pWMUmgVKLHIcv4FCQS3oA1FFzXd2X50y3q1JU6iO23bqF1Scwi1PepQitih6SI5wVsLrac+EdvypE rTq80VuP7W2RYuO1MLaynu6nCYOH+3+398mT2tPHKWJktKnk8ZIgAijIOPOX+ukT18+TPT6JevnLc E2BUW673gErXCohnYjO1SDqXhd+Xi7asG3QNu6qLS83gGwBhxUSekxB9F24lm3OWADnoirynrqW/x dEqavwWHQvc93AvJWjVeFw==; Date: Sun, 15 Sep 2024 08:55:32 +0300 Message-Id: <86msk9ea0b.fsf@gnu.org> From: Eli Zaretskii To: Suhail Singh In-Reply-To: <87ikuxq2wb.fsf@gmail.com> (message from Suhail Singh on Sat, 14 Sep 2024 18:36:04 -0400) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87ikuxq2wb.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Suhail Singh > Cc: Suhail Singh , michael.albinus@gmx.de, > 73046@debbugs.gnu.org > Date: Sat, 14 Sep 2024 18:36:04 -0400 > > Eli Zaretskii writes: > > > If 3 surprised you, then the reason is simple: sit-for returns > > immediately if any input is available, so typing effectively disables > > the wait. > > Interesting. I didn't expect it to do so persistently (i.e., for > subsequent iterations of the while loop in question). Since the command still runs, your type-ahead is not consumed, and each sit-for exits immediately. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 15 10:24:43 2024 Received: (at 73046) by debbugs.gnu.org; 15 Sep 2024 14:24:43 +0000 Received: from localhost ([127.0.0.1]:50418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spqB8-00082y-Ud for submit@debbugs.gnu.org; Sun, 15 Sep 2024 10:24:43 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:54619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spqB6-00082h-3F for 73046@debbugs.gnu.org; Sun, 15 Sep 2024 10:24:41 -0400 Received: by mail-qt1-f193.google.com with SMTP id d75a77b69052e-4583068795eso25064351cf.1 for <73046@debbugs.gnu.org>; Sun, 15 Sep 2024 07:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726410202; x=1727015002; 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=cW9BZwR8Qk5FIiXWZz4ne2potRLhSu+oL1p2+AAJwrU=; b=cZfTrcZSV6F+5Qbxh6SMkja1gwkV1qmIXiubI25+L0pwDb3LCCaYIBSbpwn0YYZIQK NjkuG2LDiNplth/cJAmxWmwzqtKWtvx7N+9DPg7sUKHPYXwy5ayz38KF2SoOhP53u44c 92cxX88bVN7IzMMBMSZEvYy1Ft3kdH3YjNjA8WYGwd9w1856RqbQ+2VJdrrtATxbviQA B1H7HGTm0gwmbrla9JpRjifH69tqjfbiRhtvNAtcXn7p4dVwwBHql0AVwfDwwcD0YUdb l85fIww57UYyvPh0IGfYqHGkHBvcX2pwWJgInp1R8SrCBN5HgzXyl939aCKhuV/BDFcU KxCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726410202; x=1727015002; 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=cW9BZwR8Qk5FIiXWZz4ne2potRLhSu+oL1p2+AAJwrU=; b=tQ6zi5rr4zjeeLUjL7zOf+tjed2cxPZbornvSeCOFWmr69MGFOfH8l3+J8Y+xemhyu Iw+A/xoWlUbH1Z1wWiVVn+r2zRJYnzaKygXD4zyuRANNitDzxZCNqv7Fl3OGejZoFNRP 1FaHzdEM0LWwVb7m4Zx5/mWzHoyzpoYlFYwKKtBG9DGYI0n3ZYNk9Jhve3KEVJ2PV2G5 mDKqZpANdlqAfgSta3yPu6ZC4gGZW4EJRpVyjXJn9+D47hJ2C3Xl0TKwJViIHeG2YX/R LeKjOyVCoQkj/vrc8BWKnnx6kyiVYnk0NUVQGR+HUI9C9XXKF/m6W2gmXQrilA3/kr+d DGUA== X-Forwarded-Encrypted: i=1; AJvYcCUeMXmVIdvprbB2GgHu1DV+iovXWgMMzPjAd4XKsEmXp/GfKuIKm+tRAAWrDiM+/NGxBe4q7g==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzEERG2+oQ5Djp1aBClSq4SLz+F0aVAGeU3rTpJFo6JP+DtR3gX KTVf/hx5brLRZauFqPqedl/ZHFrQXQ0G5/+ocZQ3Lw+ni5uGHnuUgwdTM08M X-Google-Smtp-Source: AGHT+IHTDkJmIUOSvqjfPMqNY4KeXXjG3Ud0tgrbdGeTd4nH0pfh6saLFL4jl8irmRBE+v2KaPuP9g== X-Received: by 2002:a05:622a:189f:b0:458:3cb6:13cb with SMTP id d75a77b69052e-4599d2b6e27mr124531761cf.56.1726410201765; Sun, 15 Sep 2024 07:23:21 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-459aac611besm18210171cf.6.2024.09.15.07.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Sep 2024 07:23:21 -0700 (PDT) From: Suhail Singh To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86msk9ea0b.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 Sep 2024 08:55:32 +0300") References: <87o75241qh.fsf@gmail.com> <87le0450x8.fsf@gmx.de> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87ikuxq2wb.fsf@gmail.com> <86msk9ea0b.fsf@gnu.org> Date: Sun, 15 Sep 2024 10:23:10 -0400 Message-ID: <87h6ahc7xt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: michael.albinus@gmx.de, Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Eli Zaretskii writes: > Since the command still runs, your type-ahead is not consumed, and > each sit-for exits immediately. Ah! Thank you for explaining. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 04:49:27 2024 Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 08:49:27 +0000 Received: from localhost ([127.0.0.1]:34048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srZKR-0003tq-1J for submit@debbugs.gnu.org; Fri, 20 Sep 2024 04:49:27 -0400 Received: from mout.gmx.net ([212.227.15.19]:38719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srZKO-0003tW-Aa for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 04:49:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726822139; x=1727426939; i=michael.albinus@gmx.de; bh=f0hfNOls2/XWY00IuslGWS10m8B0wIpiXW9ovGeqNHA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=EvOhU5Fswpcy/u8URlra1pirBJc7mqTHTUna+ZRGlSxLnCxRo0XcpVQpd+8k/ZK5 XXNODxBFLvedjwx8FqZFGuQgZwtr9vaby/bc6vfOANB+FPS34zeNyAHlwB/U4jAb7 MrBIUjE9b/S5+PPeHCxk3fDTtgOpRNK6DxF3xk0992Lm7l9HHIvgCRL7AktpHtFaG QkJiuM8BtFo/A2JxpauryOXt024TB9k2rAuodhYCU+RXZtJkexykD24hB8qx5+Wlj ghKom6TWkJP6PtNwz+4g6fk3B9O8DnyrVKUImQ+ph8a52cYEiwiCt57/OvscsfZ5k k00x2+RLXTo+hqmyZA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MEFzr-1shMAo0Qa5-006z56; Fri, 20 Sep 2024 10:48:59 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <871q1m47v2.fsf@gmail.com> (Suhail Singh's message of "Sat, 14 Sep 2024 10:39:45 -0400") References: <87o75241qh.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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <87bk0qww5q.fsf@gmx.de> <871q1m47v2.fsf@gmail.com> Date: Fri, 20 Sep 2024 10:48:58 +0200 Message-ID: <87jzf6k8w5.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:yk3ucSRcPTcvF5y/O9JKULqbhgzhbnBOHllgO/KhGiqhXF6nvpN amzaS1Kh/2Nq3j8ML2rqnTrjEOvjDcPwhK+gYNbD1qV5Ga/8JXgWNNsFfKLvn9xTzupayQc wuWC4eqy/8HgmUcTjsy06W21QMkxuN2bHfeIZgqzWMcp8DjcTWn4M8LmRxXGnTUHd2oEXsX OtU3P2c6FAp7aqo/p/gDg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:XgxKsWxCrO8=;bgy8oeH3SNMeaE38q6lWltQtCOC mqDRwNFkOm0UrtJf/W7UN6nuxpPs3mGSDmSkkTCeG3ly94l7l26xnjcAq69tJ/96fEbY2CzMj E6e8VQE0qNrvq2jNpRRxMiMLOui64SFL30yjRfMK8xiYHugAUQBPe1ouwr5HyQjCmgzsDFm8s 8QOH2HlilWzMwr00IXQ/Z4co3Je2+6epE4oR0YqJ1s7+WlZKvJ0EBGA8zw3Dwx5TgqxjyuYju HPD+Fo93u5FlC/TdYUi6EhGIE3ArxOoj+anSc1p1+NTYG+Rrkp2gYB8C9+lo1tw5sk607ftw6 DF7Q3aMQY6GxLGtR0aXj8BGxpE2IvCU40QsEsdkMUmlleSKKAPYR6p6Tq/QfrV32DIaTJxzP1 17sPendtINbPuTc6PFDrnHnA4cgpM5Fbmjuto3rGqKVyucDCxusxhQ72V/LcmXTystyGvvJg6 1pYA596gbVY1slMp0BPYGrkNav8tFDxwwwWJVWmNkh6+yfmJOrkEIZ2XdO4JE+o4jrPznTovj X7IDZ2RvHP74g5OdIleYQo0rL4pVIGyYii0yWWjdjYAvIpewxyOf0wfWr8Y5MIH4lbcWFiqPC /PnT9wgJMsaeziGVstUcG2fN/ydDtYyHcwALOsReY/Ks5XDnz4/yf1CW2KuVigQppXHFptBRi sjHyMe7ML1RcyJoIXXWo/FM7OKyygP9M1XtMMnHmM4D7YMg05po/pGZ20UJp+2x8QzzEaj/hu ot5wuzoYxyb0O5pBcjYdSijqBDwvr0hihJzt4MtIQFkQSKNUKTjY7pUVcH8TuV+Qxi7xr6r+h AtAMJoqGQ5e8RHfvu8DNhjLQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi Suhail, >> But there is also the message from Jake Nelson, reporting problems with >> the (sit-for ...) clause. > > Could you please share the reference to that message (at your > convenience)? > Regards, Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 05:55:10 2024 Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 09:55:10 +0000 Received: from localhost ([127.0.0.1]:34091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sraM1-0007M7-NE for submit@debbugs.gnu.org; Fri, 20 Sep 2024 05:55:10 -0400 Received: from mout.gmx.net ([212.227.17.21]:41043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sraLx-0007LU-Rw for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 05:55:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726826075; x=1727430875; i=michael.albinus@gmx.de; bh=tVPP0cu3injvYKr6EnnZiyWg7TQB1VoTkDiGHLPM058=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=DrY7is71aO9SJS1xchOIPGk7Jhur2Dgn79VAubWRdoVdmGAJVnYGGYTJCbZ2W+rm vg1j/al2cl2bU4Z8NCrkR3WQ/c9XqmqFwr3d5Ckn8HtW5oucTBhkdXN+UEv/DIN0X vRfi3/N/0hWCcxRxzs4fngyBLNjwyaSCpFLe0s1CoOz+HnDTLjBn1HXc6FOciUfDZ PAidLrs+d8aCZQaR0L391JQkDa2ru/GpWEPDb1c+bFLD0Uk6BPjxRndAkdn1czV2e XtNycVZZnEaSM1LMN2KauYYkwQkvCt/8snRWbSCspKxJXxycC9BhBHOPDGWHbfyRg RBzwmj0SEDhF4XHkDg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MryTF-1sCncM2ZLZ-00foyT; Fri, 20 Sep 2024 11:54:35 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <86ed5mffbc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Sep 2024 18:03:19 +0300") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> Date: Fri, 20 Sep 2024 11:54:28 +0200 Message-ID: <87bk0ik5uz.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:FBc6lwAUiL4MJyAWqn3wH7pEi8Zx4i8zFX82zVP8hwfc2/uZr2K tni5xsQly3rnUqAAYQgwezuExzdxwKwNGEWAeQcEYRfuDKNOPJJxP8fsvGhGD9LQJvd9t0n 6NctX0CX6FY8iN2VgMNEU1J9KcS8Vg3rLiHQqjQHu82zQjinR2oO440TNmii1FKHkFJ0ATW MyU6Y+LYTLxNSVm498gKg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:yKbc2D2PFL8=;ARKZss46LYGbbW9vmAO6iQckB5q cxV0m5EiSkwCXDNw0SPvDzM6QpmXuNIA9lUFU7W+MxEdD0gqr02V17RSxgLF0ETUReGUItJgz uv0DWCaXzwXv7xqOdmhkwVcwIO32XlkzmrpKSJislR3bEc12Ghpj1jkbsMcup2kyxFQfOcWuq joHKlB25eAE3qY73BUvDhn/gQovZ9gpYAdmC+8ApGivr1xDnYoIGPkoK8it2rPNtUIboiwW8E R0/WBxdxb7BOVboTqMguzG6GT6BloUPk5JEjY6ivQt9Q8Iks/mYEXoJY4+eOZdMWax69flfM7 ckLnGy4z2tFUwCOou5rk0FnxDK/epCCqHNZtAeY8U+9ig2B7OQKf4sbGQ+cUst9vVGiXHps3p 6CcFP4OM9voJ2VI8C2TwRaU6y+O4WXUPNvFLBrv3Pv2FFDss4HUcZA8eSV77FrXuDDzFrDzyT NFWcZyOakPo0Pchgcenk34qOE7TUvIsvQJf9V6lhx/vokvV2MBkvXNs5ihehCCipU3bqMscqF IP1a04/mEveYYfu24wYMwbm91zh4HjJEqwvsRsFUhT7wTLWT0Pb3NBX1vMOdfaHRlBxnSi7Zl dC+tUQ3J+PQX3iN1SwaWK5bokwqfKYod2EpVBaRegi/RCks/FiR2f9H8lUl4ZLSDCFdQCmcrj KFaOfS+cuw4yOGjmND1+fKOIkvoix/LDh/h/Qi07HRNljK+H+M1f4WtsDlBVtOTcHqv00QUp7 0SyHY7h9ZxYvkWGwM76qzH9YgWw1azQzEjLwBIzreFZ+HV5CuBghRm9Q928l/5VU4FbTXIOkk VRCahvnSLbSOEFKDvATpC01w== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi, > If 3 surprised you, then the reason is simple: sit-for returns > immediately if any input is available, so typing effectively disables > the wait. This could be countermanded by unconditional sleep, but > AFAIU Michael is rethinking the whole issue, so we should wait for him > to reach his conclusions. > > In any case, interrupting the wait when you type makes sense in > general: it means Emacs is expected to respond sooner, which in most > cases indeed means to stop waiting immediately. I played with the different configurations to use sit-for. The test scenario is simple and can be reproduced with any remote connection, be it slow or fast: --8<---------------cut here---------------start------------->8--- emacs -Q /ssh:remotehost: M-! sleep 30 --8<---------------cut here---------------end--------------->8--- This starts a synchronous remote shell-command, and Tramp must wait for the response in order to return the exit code (akways 9 in this scenario). Observe the Emacs resource consumption by 'top' in another shell. As a second test, I use the Tramp test suite in order to see whether there is performance degradation. It is sufficient to run the test cases tramp-test11-copy-file and tramp-test12-rename-file. make -C test tramp-tests SELECTOR='"11\\|12"' 1. No sit-for call at all, as it has been the case when Suhail reported the problem. Emacs consumes 99% .. 100% CPU. The test suite reports --8<---------------cut here---------------start------------->8--- passed 1/2 tramp-test11-copy-file (1.645027 sec) passed 2/2 tramp-test12-rename-file (2.172439 sec) --8<---------------cut here---------------end--------------->8--- 2. Use (sit-for 0.005) in `tramp-wait-for-regexp', as done initially with my patch. Emacs consumes 42% .. 47% CPU. Good. However, the test suite reports --8<---------------cut here---------------start------------->8--- passed 1/2 tramp-test11-copy-file (5.311830 sec) passed 2/2 tramp-test12-rename-file (4.451581 sec) --8<---------------cut here---------------end--------------->8--- This is a serious performance degradation, which isn't acceptable I believe. 3. Use (sit-for 0.00005) in `tramp-wait-for-regexp', a much shorter timeout. Emacs consumes 72% .. 74% CPU. Not ideal, but better than 100%. The test suite reports --8<---------------cut here---------------start------------->8--- passed 1/2 tramp-test11-copy-file (1.643277 sec) passed 2/2 tramp-test12-rename-file (1.800990 sec) --8<---------------cut here---------------end--------------->8--- This is comparable to the initial values (there's always a small difference). 4. Use (sit-for 0) in `tramp-wait-for-regexp'. Emacs consumes 72% .. 74% CPU, the same as in 3. The test suite reports --8<---------------cut here---------------start------------->8--- passed 1/2 tramp-test11-copy-file (1.562353 sec) passed 2/2 tramp-test12-rename-file (1.626922 sec) --8<---------------cut here---------------end--------------->8--- Seems to be the best compromise, I'm in the mood to apply. Comments? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 06:47:48 2024 Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 10:47:48 +0000 Received: from localhost ([127.0.0.1]:34220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srbAx-0001tk-UG for submit@debbugs.gnu.org; Fri, 20 Sep 2024 06:47:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srbAv-0001tV-LL for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 06:47:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srbAX-0007WW-4p; Fri, 20 Sep 2024 06:47:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YaFB3VZBIGcu7T5XmW/3H7QecErrbiq0er2nqsuqTYs=; b=DsH6cRCTRHne i6Sm4vSrCa49PfiSB8M5T7vCqjkfhfzs3Dqfv2n79qCacRs+igiF8hBj64Tn8GdNiDrCDtH1gTrCq eDVGaFZ6T51gL1k72x2qero4HWswGl5oIPzyEFsstfPe4SgXmE5HdqEOq8rdao97VI7Myc2sGMYVv xMiYJXQoKaevDFgiBSlgTHbMXuJP37SfKhXGzpVmn0NOglUOeXO4NV5UZy3GJlSo8IFiG04h06HBX obHkxcAJCv2orjj4GVCLjDlt3ZpHhPpMXtN/GZyeVae7OFG6MBfkLpQ6RYkO0d6rB3P2VB7RyLOFV rRIW64FGM1kbhp/MANjOpw==; Date: Fri, 20 Sep 2024 13:47:15 +0300 Message-Id: <86ed5e7gb0.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87bk0ik5uz.fsf@gmx.de> (message from Michael Albinus on Fri, 20 Sep 2024 11:54:28 +0200) Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87bk0ik5uz.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73046 Cc: suhailsingh247@gmail.com, 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Suhail Singh , 73046@debbugs.gnu.org > Date: Fri, 20 Sep 2024 11:54:28 +0200 > > 4. Use (sit-for 0) in `tramp-wait-for-regexp'. > > Emacs consumes 72% .. 74% CPU, the same as in 3. The test suite reports > > --8<---------------cut here---------------start------------->8--- > passed 1/2 tramp-test11-copy-file (1.562353 sec) > passed 2/2 tramp-test12-rename-file (1.626922 sec) > --8<---------------cut here---------------end--------------->8--- > > Seems to be the best compromise, I'm in the mood to apply. Using (sit-for 0) is IMO okay, it means Emacs is yielding its CPU slice, but is ready to run immediately after that. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 10:19:47 2024 Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 14:19:47 +0000 Received: from localhost ([127.0.0.1]:36063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sreU6-0005lA-Nm for submit@debbugs.gnu.org; Fri, 20 Sep 2024 10:19:47 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:44197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sreU3-0005ks-QG for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 10:19:45 -0400 Received: by mail-qt1-f194.google.com with SMTP id d75a77b69052e-4582c4aa2c2so12245471cf.0 for <73046@debbugs.gnu.org>; Fri, 20 Sep 2024 07:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726841899; x=1727446699; 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=h2jQlOMhH6ik3liYsOmsLAKsZOLggAvDO7qicG2h8Bg=; b=UEcLyiUo8UC/lFhedTRcnwQ58hxBuFBgEKndMdFMgACy7Y/HwH4IPPeKZye2vhEKKR ZxgOe1GpyoYvkgdwOlSRf4XW8apiBCJaIdVMnqhDH5njbop5lsk0fXGEF5exHFK0VQMW OQZBXMtjOsWy1NzSuOATHZPsxAt78n4CtbXd+C8xu5sqKbblhOsjVGuUgFkjmHcIFPiJ bFwziU7BC3BT579dyC2G1L/Ni6Q9D5xEFCl8SMD8CSkn6FE0uQ3oMirl9f0Fo7Gpab9S vjrDL9hzsaQDb5RfxYrPJnQA/PxYzcWTsY4QgKmNScpx8zxPHAD7OEKpeeyNs31o/x1W ht8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726841899; x=1727446699; 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=h2jQlOMhH6ik3liYsOmsLAKsZOLggAvDO7qicG2h8Bg=; b=dL4Q7DLtgTKe/KIn0IKozyWNJGoDngDEVkM+TJoiL28O87w14yh/lJ985wSXj6ATPh MtYFIvboXnXOlQ1bZ7NooX4XCnZewT1NFw20pX2z5PjnSUjbkKk05uWflpnjxBg7cvb3 Bmq79FKyyZCjHeAV4dwIiduam5ub6S4H0EPw55HhtspP0KiVLIyZyL3TnEZV5hwEsvQG vhdP4J3jdc59hmXiqhkeEptUEU4wyl8EXcAn8W14cL1v5jswW/xAQwK/VBSc1vku+1bi 7ZfbIiNTRMUOyspR5iMys3LfEl8DjM1h7Jk5EonZw+i3qHiFRvIYWB0LnnOTfpDMOWmy z/sA== X-Forwarded-Encrypted: i=1; AJvYcCX7d+e24WHJ35/0//Ep6T3laiyqtrTlvCNkMbM5yfBadL3TDKRwyfGVjqC4tQT5K5kyyzkN3Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx9J1LARYt1/M4hi6dHJ5VXVpHZh5VljjW3ryT7W5h19No6PnL+ jj3Pz3jns6DF/pTF1c3ffb4oiuVQtm+pAX/wXRG442rjoC02RMX7d3Tj7L0L X-Google-Smtp-Source: AGHT+IFfSGBQRjVNr/3L3d8qtpvzHau8VGI/TfYLUC0HsamUxwdk7wpDzjMHahR/tkflSq632W4WjA== X-Received: by 2002:a05:622a:155:b0:458:253b:4151 with SMTP id d75a77b69052e-45b2053cf68mr31118171cf.42.1726841898732; Fri, 20 Sep 2024 07:18:18 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45b1788c079sm18117331cf.48.2024.09.20.07.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 07:18:18 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87bk0ik5uz.fsf@gmx.de> (Michael Albinus's message of "Fri, 20 Sep 2024 11:54:28 +0200") References: <87o75241qh.fsf@gmail.com> <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> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87bk0ik5uz.fsf@gmx.de> Date: Fri, 20 Sep 2024 10:18:06 -0400 Message-ID: <87zfo2jtnl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Michael Albinus writes: > 4. Use (sit-for 0) in `tramp-wait-for-regexp'. > > Emacs consumes 72% .. 74% CPU, the same as in 3. The test suite reports > > passed 1/2 tramp-test11-copy-file (1.562353 sec) > passed 2/2 tramp-tes [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (suhailsingh247[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (suhailsingh247[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.194 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.194 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: > 4. Use (sit-for 0) in `tramp-wait-for-regexp'. > > Emacs consumes 72% .. 74% CPU, the same as in 3. The test suite reports > > passed 1/2 tramp-test11-copy-file (1.562353 sec) > passed 2/2 tramp-test12-rename-file (1.626922 sec) > > Seems to be the best compromise, I'm in the mood to apply. > > Comments? Seems like a reasonable compromise. On a related, but distinct note, thoughts on whether there's a relatively straightforward way to address "3" below (from one of the other exchanges in this thread)? Eli Zaretskii writes: >> From: Suhail Singh >> Cc: Suhail Singh , michael.albinus@gmx.de, >> 73046@debbugs.gnu.org >> Date: Sat, 14 Sep 2024 10:25:13 -0400 >> >> Eli Zaretskii writes: >> >> >> 3. If after invoking M-x we immediately start typing, the keyboard input >> >> is registered, however, it doesn't display in the minibuffer till >> >> after the offending directory has finished font-locking. >> >> Additionally, doing so invariably results in 100% CPU usage for the >> >> duration of the font-locking. Sometimes invoking M-x alone results >> >> in CPU usage going back up to 100% (while font-locking is still being >> >> done). >> >> >> >> Thoughts? >> > >> > Are 2 and 3 new with this patch, or were they present in the previous >> > code as well? >> >> Present prior to the patch as well. >> >> > And what do you expect to happen when you press M-x while Emacs is >> > still busy performing your previous command? >> >> I did not expect 3 to happen. I.e., wrt 3 my expectation was that >> invoking M-x and typing doesn't result in a noticable increase in CPU >> usage for the duration of the font-locking. > > If 3 surprised you, then the reason is simple: sit-for returns > immediately if any input is available, so typing effectively disables > the wait. This could be countermanded by unconditional sleep, but > AFAIU Michael is rethinking the whole issue, so we should wait for him > to reach his conclusions. -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 11:36:13 2024 Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 15:36:13 +0000 Received: from localhost ([127.0.0.1]:36101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srfg5-0001kZ-9U for submit@debbugs.gnu.org; Fri, 20 Sep 2024 11:36:13 -0400 Received: from mout.gmx.net ([212.227.15.15]:57519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srfg2-0001kG-QQ for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 11:36:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726846542; x=1727451342; i=michael.albinus@gmx.de; bh=VdyWacqTO1/IMmiLJ7LK7FjQx/CQJT2iPlOv3mF7NnU=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=pt3fcEpUaw30Lwo8LFK0Y3kxORa7KhL4l+Uz4wejKEQjzn+gk3Y39xrmy+1LpA87 an0Xu7tfUslG/oIhtCjV3f4hySTkNb1Ob4mz6+rlaejmftysW7yVIrS/rDysszxJ5 ZFE6IVfF8M9nVWGATkeSl0o1zEyFN0nwcNi3/La1CywaXFBJTbqqD7w5ew/uukZUJ /vegwpPUhGuVW9iwKRBN2zIAUGiapmjbmnmkRjgy0skwhrek2fUGOdwougIKwNcZu LtFNEndfNPCzn/L2rdj5jg808dKwUCjVcO268oUHNxcpxp1oAR6p//Rvs06rXzBHu EXfhbAOct7FtbEEM9g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MfpSl-1sKFnT1VwP-00jbWk; Fri, 20 Sep 2024 17:35:42 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87zfo2jtnl.fsf@gmail.com> (Suhail Singh's message of "Fri, 20 Sep 2024 10:18:06 -0400") References: <87o75241qh.fsf@gmail.com> <87le0450x8.fsf@gmx.de> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87bk0ik5uz.fsf@gmx.de> <87zfo2jtnl.fsf@gmail.com> Date: Fri, 20 Sep 2024 17:35:41 +0200 Message-ID: <87cykys5gy.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:FNWiGjkh5F5voFOnfoGV5GhRQOOy5CkQNkQeA7rUsCm6HujaECV rULAJrw6ZdtfutN1IBnqYjC5JhUTAsm/L+XjfAwYLGwf4Dq4grBAQ5Z7qXYGnxVX45RE+V3 bwnWRZxDIgtUkUKeVXVzlHgyox1LKywMQK0k66J/pgQI8srgpz0Gy3st+io8nlxrwVwowjR +bEjH25tKpBTuRQcb7XZQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ctXGt9szI+M=;x9uIXV0BDOOC42Y3YI9FDTj+cLl tvuNjG8npec49HActYYBDvJu22f+38lZ8jOnSa/XADHvsAX94c2OgA9iGHukZfdYhIxlzEmmJ dKwPVDxrYOWUM5WLA9dJD1HGp07QJBFVglI+K5xQtrvd39rurYYvnr1Fu53RshT2B+JPFs1Sy FNCtaSXGsWkoBPFdAtm1brIA8rAjOsXIU3/xNZae080k36CTKleGbXGURa7BVxAtsd4vt4Vr0 VnEzBbAvuqRevwOhlcBXSWb55iXSgXb8D1XhMIFem6oSlnThOP4xBeHoWqLtSX+VOwBPBsWPa 1+CmP+d/P4F3y4mHL1ztjsfyLieexLrriobgD4Me+1y6RWJi2vlQx5oxSEa+OfSV99AwjDkxd THHw2B+HGkIE1ddCADiZyNY+0UNXG5mOO38FtuynrHgJcm2ryA6VFUWtqod6Q4cxrFBeROo/P juTemImRA7WJIXW4RwvDFRAIyn2GvyL8lE8EpK3BvpAR7bl1twRiLblO+9Qx5DrmeX+YGr0fG qK2wiL/LroqkXExUCqvmi325Q41h/1YZRWq45yl1Jux+HuWieZgx0xh/k8Y/1fQKc3sdg+9MJ JIVSP8+FytvognSxN+j8eo1l189fRRqxce9QjK1D6I9yOLKD3FR2SwNE7k6QV89LcqdXgb1Eh 23mYP2OrEY/97lNSNLBVKPX+TOCDYXLl9Efy63bPvx9tZxL85jq0PrEHKKPthgDKHPM4pkcI9 J/hPvf0Lh9sMQHBHlw6uQDfP9iM4FEl9SZ8kJ1GfViBeB48EHAObc2flC8XQsqncuLp6abra1 bpQEEzHGShnDhOlkA+Hfa2qw== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Suhail Singh writes: Hi Suhail, > On a related, but distinct note, thoughts on whether there's a > relatively straightforward way to address "3" below (from one of the > other exchanges in this thread)? > >>> >> 3. If after invoking M-x we immediately start typing, the keyboard = input >>> >> is registered, however, it doesn't display in the minibuffer til= l >>> >> after the offending directory has finished font-locking. >>> >> Additionally, doing so invariably results in 100% CPU usage for = the >>> >> duration of the font-locking. Sometimes invoking M-x alone resu= lts >>> >> in CPU usage going back up to 100% (while font-locking is still = being >>> >> done). >>> >>> > And what do you expect to happen when you press M-x while Emacs is >>> > still busy performing your previous command? >>> >>> I did not expect 3 to happen. I.e., wrt 3 my expectation was that >>> invoking M-x and typing doesn't result in a noticable increase in CPU >>> usage for the duration of the font-locking. >> >> If 3 surprised you, then the reason is simple: sit-for returns >> immediately if any input is available, so typing effectively disables >> the wait. This could be countermanded by unconditional sleep, but >> AFAIU Michael is rethinking the whole issue, so we should wait for him >> to reach his conclusions. This would mean to use (sleep-for 0) instead of (sit-for 0), right? Hmm, I might try the same tests for this clause next days, no idea whether it makes a difference. But ATM, we should use (sit-for 0), until we know better. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 11:44:36 2024 Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 15:44:36 +0000 Received: from localhost ([127.0.0.1]:36113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srfoC-00029C-Ao for submit@debbugs.gnu.org; Fri, 20 Sep 2024 11:44:36 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:49265) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srfoA-00028i-Dq for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 11:44:35 -0400 Received: by mail-qk1-f193.google.com with SMTP id af79cd13be357-7a99fde9f1dso189079585a.2 for <73046@debbugs.gnu.org>; Fri, 20 Sep 2024 08:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726846989; x=1727451789; 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=CgsujQsv9TAFV/FHY+WJ1R2ZfQnDB6s+ppPNd2dQ1yQ=; b=HKZXDU46bpAVZPUfhovyfqIGyolEDPFamS6HAh0FNP5mpyAfy+IWx6U3WaiVy2fh2E JRfAhjq7bNPC5KiFABO/jmQ7QGmhEQSD2WVR6zM8693fIaNTul5mKm3t0QV9Vnjmo+MP Ce1w7N1WxHepfmmntXSrO6cdxaTyMOluhyPrSmSy9GLvVN8AF/qiWe9WgVSH71KCRSff l2YlGZ5A1NPTaBeiWeYLgrnst79NoUiHW3PK1lvyprqDXw8Deh6P4Jr148aQb4T17qP0 BWjudS6zNq8T47IvLY15k3PdndGi3pzb6LE9zJAOt7vBz3AKpK8gqRIZWgy2xgB1+PIo 9ZAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726846989; x=1727451789; 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=CgsujQsv9TAFV/FHY+WJ1R2ZfQnDB6s+ppPNd2dQ1yQ=; b=miCoX+dBahyJCODc1Xg5onuUZE9r4zCQ+9q1CTvNuhlp2ceCfXF/RZe9m2GkkNdmG7 1fL/kz7w6R+a7ykHj2335wIi56zr/+EAES8ek4z1blVEP0iNiemXqv6FD8qdc/LO4Vec O6aZBY0iqs6CsxvmcSST1Fv3rrh6Om1VL9bHXzS0xq9nd7/jjluQCiXZ1JniDwafd84O +FHO/fsc7u8fqguL0YrqMJIFcS/94H7pA7PFK8fQhUL5+lTE0xVUeIs+f6TOH4j3B2xH Uj6ZlLDE8Ppubg/KmixLaKpG2HfSYVUJZ1SJqS/9PVy32y4jPddRu3iboyjJYSELZg9B mRqw== X-Forwarded-Encrypted: i=1; AJvYcCU7l5V/Qdx96RrXdZWfW73Rrz7iNw0We0fgxpBBut6M6WYu37d5O6pX0185paReGuYLbqR+uQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyXXkQ/odDLsgFY39a20/QzWc4+v+HCrFxpjT/0VZ9oneIQUvbb h3JbfO30hzd+Rkp6Sp/Uhrf4R0WLo3FnQNzovSgaHmhmkdlDWgZgmUjCk3pZ X-Google-Smtp-Source: AGHT+IHMrw6P2wZ5IiX57ic3HT7pvru65DVh7s/7gjvAbzAgUlAn+jgJ7vZFs/iCdKxbvZiT3/j9ug== X-Received: by 2002:a05:620a:24d4:b0:7a1:dff1:57ab with SMTP id af79cd13be357-7acb80ab1d4mr583055885a.23.1726846989157; Fri, 20 Sep 2024 08:43:09 -0700 (PDT) Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7acb08da81fsm192280985a.110.2024.09.20.08.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 08:43:08 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87cykys5gy.fsf@gmx.de> (Michael Albinus's message of "Fri, 20 Sep 2024 17:35:41 +0200") References: <87o75241qh.fsf@gmail.com> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87bk0ik5uz.fsf@gmx.de> <87zfo2jtnl.fsf@gmail.com> <87cykys5gy.fsf@gmx.de> Date: Fri, 20 Sep 2024 11:42:56 -0400 Message-ID: <87v7yqjpq7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046 Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: >>> If 3 surprised you, then the reason is simple: sit-for returns >>> immediately if any input is available, so typing effectively disables >>> the wait. This could be countermanded by unconditional sleep, but >>> AFAIU Michael is rethinking the whole issue, so we should wait for him >>> to reach his conclusions. > > This would mean to use (sleep-for 0) instead of (sit-for 0), right? Hmm, > I might try the same tests for this clause next days, no idea whether it > makes a difference. > > But ATM, we should use (sit-for 0), until we know better. I'll defer to your and Eli's expertise. I don't have strong opinions on the matter; I simply wanted to make sure you were aware of it. Glad you're feeling better. Regards, -- Suhail From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 12:05:52 2024 Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 16:05:52 +0000 Received: from localhost ([127.0.0.1]:36122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srg8l-0003ca-Tn for submit@debbugs.gnu.org; Fri, 20 Sep 2024 12:05:52 -0400 Received: from mout.gmx.net ([212.227.15.15]:40957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srg8j-0003cE-TT for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 12:05:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726848323; x=1727453123; i=michael.albinus@gmx.de; bh=nuoYiOhyc3KdJFGcy996BE/JpCeuT6GWD0sRuAaBE4E=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=Ngq9wuh42P7Sxlvu4HIPeBS8YhCudrLhIaSAakuQjTPYsVJ5xhqQs0n1JSZeUxJX 59NKQdCf4dJb8id3PmksIPpUL60VvHcbuBqfwbmFmj1vijw18Konw+dHlr9WDC6Kf J//wOe4+dFvaUKRpf+7D20EUdBw44QnWzvhgcoJDrRwywi+MvyYQs5VZy7eeyRecz eSqIi72kQ9/BnZ14a8r06QYYDiXnaisaxaA5f/iO+54bCmV7wrE9WUkhTGdbsDW9N rBDRZiKpaXtmWZZ8xVQ2rh3DdQoZSYZX+W46k4XEk/kDuDn8tFsqTRqc7wo1w8ZuE gkm2UjQVmt3AUWkdKQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N8GQs-1rwQnD0KRM-00xrlK; Fri, 20 Sep 2024 18:05:23 +0200 From: Michael Albinus To: Jake Nelson Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87r09nwo6z.fsf@gmx.de> (Michael Albinus's message of "Fri, 13 Sep 2024 17:47:16 +0200") References: <87v7yz1sw8.fsf@rutgers.edu> <87r09nwo6z.fsf@gmx.de> Date: Fri, 20 Sep 2024 18:05:17 +0200 Message-ID: <8734lus43m.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:mtvysXR8mqgLFiyAILn8vPtutrCDYGMMTYOXXY19dGQnQ6V9vg7 TJRfs866tiwgav98jLrk9tdFCMpvmxX8P0hPwO3Zr0HMO1bu9szQ9DHTUPIWVeaHikOGQSW FfYiEUHplu2z8pCXIRFPQ8soEQ6Hl0iVnx59U53lAASv2Nrl/aexqui/o3WSS3TqqU5uYmf 9xhIIXVSQz1Nlopjra+bA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:K08YxYRXzdQ=;hE+r0KnGEXzWfJeeiB2wPmJm/ev TSpyRYH5+r+6hzrgUFS1DWJ5Utc+e1kISDnlfTJ6ef/tfbPFdilG84YizOqkKLoSdeZIrbEbC adveV6XAgiPcNUpnBQk0fWJzNLKZMMyCOv38P+xpDPwfIkRFNrKctXtk8lFYmuhaWubtZs8+G lxe7Pm81/MFayLrbGH6eotUtjCWWzyAu63Mfu2w7NR9LbUqibMzONXqbFT17HoSI2N7a49Oet SuM9EWHB7LvW2NvFCzhGgX5SXy1QH4PXAPp5M+JLnkzYA0a3g4E7V3XHVJ5KS1bnvXCi1y+jR 62F+P0vk0ihkrdQyTvjQDCG4TcBMv0CUKGbzvRBDbPaSRghrN5vM61fr5ULhaTKccVssruDOD gCxPhiGMGObjPmTS/8gDGXLPp2YoUHgtKoVl8XOqEOoaOqSA8nMz/wp8sfFuq6olDmRVbS0Ju C607+LxW/7eCLEEOy0z1dpjw6wFAp6aReL4fD82BtKjcx75q2z7j83frkbrE1ruNciS4qElDN Kjn79VMLeEHyw8W2bzKEffbv0V/cNfphxEUc4ywEV9hNg/iVN/7616V6yAA+tabkYqo627WGx l1csptMcpf1SH8KrE7+RGIsVk3ZtrBaX1icvQQNtX41MnBfIiKi9wcaTrZuv2qgXf8rjrGdf5 C5PrV48XkRgt+mKXOiUFk+0RbDf6gYqHgGl4limXsmfah77IpkjUkyxQ0dhy96jL/cPpaF5JY 59pzaH2bokTIKccLk9D/xmfLI7IdwVJM3oBzIMM0EdIJBHtDSli/Vdr3DOAX/riAfRE6XL0kG 8L+EdQdt27FUX2fKWMgXHbMw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Michael Albinus writes: Hi Jake, >> I had to revert 652a8a0838b38a6eab85c55fc61cedd1c61ef20f >> >> I could load a remote file with via tramp, but attempting to edit the >> file spiked to 100% cpu usage and I had to C-g to recover. > > Could you, pls, reenable 652a8a0838b38a6eab85c55fc61cedd1c61ef20f > temporarily? Then recompile Emacs, and run > > # emacs -Q -l tramp --eval '(setq tramp-verbose 10)' /ssh:some-host:/etc/somedir/file.yaml > > Try to edit the file. When the problem appears, return control by > C-g. Show the resulting *debug tramp/ssh some-host* buffer. Likely, it > is large; you could send it to me directly. Ping. Could you, pls, provide the needed information? Otherwise, we cannot do anything for you. >> Thanks, >> Jake Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 00:07:19 2024 Received: (at 73046) by debbugs.gnu.org; 21 Sep 2024 04:07:19 +0000 Received: from localhost ([127.0.0.1]:36868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srrOw-0001mN-7b for submit@debbugs.gnu.org; Sat, 21 Sep 2024 00:07:19 -0400 Received: from mail-dm6nam10on2112.outbound.protection.outlook.com ([40.107.93.112]:9037 helo=NAM10-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srhB4-0008Bu-RE for 73046@debbugs.gnu.org; Fri, 20 Sep 2024 13:12:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rHh/cMzsG6+8qhnwwth+yh2ctUNYonL4T8kzwzdK8wIfkHmX09D8TSHWF4HpaBOFzHK/15yl1bt1/NUMqNArQOWSwuVjbCFfV9oosUllZNujAf+oJq/uEg6DwdcvU16cmv3LMVRjMINAnmTtpkCUpflpiBGXVqoAII2yQxDSTv8AOG5g8817q1UGGhCKVeyABfB6pQOXqpMbU0G2eDL+befXJJ9eirpLTyQ2Ul+IiO1UvAsTTTYF6Yx0VrXnat1Aldwi5AP8FqIS34D1i9OAurXw14RDN16s0mjaZKrfsSlWKWTJ1FNC2k1AbqsIvjn44OsNztioli7v5Zk+w1UVxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ia5jbNpjvFLGGsjyi6PTAUpGRaHPe3jN+jarQ3OnZ10=; b=UkIyq6065Pm2aIF2xzlPJNIlhvJnl3Axi0vdfewx7CX+RZkzCKU1i0Aq02Y7KoJvvwfy1vJNFQvvXp0TsPubori9XNhwAEm+H+kySzKJAUPjhdoMEI39aDr7lUHXCHLhZogKMoYxFHMDnE8Uu97oZNyYD7Z3DMHfjvqvomY+yNvsh4ZyiEop3yLSDl9wg5b5wR2SYtWw5f9PNKdkRTa3x6uLXV6Q1fe9AuIA6uO+qmlTGIXNhTmLcX/zMZ7DovW5Y5HAK1P9G6oco5q4buMFpoAFC49RD27G388ykH+i8NBL2m/tRf2O6mHbDKnwUEE73/KWNXQCA2cp6ns4QDVX8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=rutgers.edu; dmarc=pass action=none header.from=rutgers.edu; dkim=pass header.d=rutgers.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rutgers.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ia5jbNpjvFLGGsjyi6PTAUpGRaHPe3jN+jarQ3OnZ10=; b=NghPNhOm6VuglXJZlMIZvMTo5B3fBJXNNvEG5QvkoKY3UrlN3cpv9fSofWVg3cuvv0WoWazeT8Gqmite8VurVz2sH4VACjO4RzkNJ0CWArbNfXy69aiK7cQCiup98nLQc6ED9qIC78qLbRTsglFyU2Q/KinXXSrNwSUw0QpPZ9788tVJy7mRt2vrUtQOlEMaGZReC6xfkhZK9XndmHHaGWu5nyOIOyayxL0b+wKPuBG0CcdAA++YSsrZyuyvefOUo+H1g/l2E94GksqWyeP2eEMo6H/yceg08Ul7M8MqiwnbgbebE1v7msM4H0SEjvEgHbMymVa5H2xcqOLbwtMJ0A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=rutgers.edu; Received: from BL1PR14MB4856.namprd14.prod.outlook.com (2603:10b6:208:30a::11) by SJ0PR14MB5275.namprd14.prod.outlook.com (2603:10b6:a03:422::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Fri, 20 Sep 2024 17:11:51 +0000 Received: from BL1PR14MB4856.namprd14.prod.outlook.com ([fe80::3962:e639:2efb:e9cf]) by BL1PR14MB4856.namprd14.prod.outlook.com ([fe80::3962:e639:2efb:e9cf%4]) with mapi id 15.20.7982.018; Fri, 20 Sep 2024 17:11:50 +0000 From: Jake Nelson To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <8734lus43m.fsf@gmx.de> (Michael Albinus's message of "Fri, 20 Sep 2024 18:05:17 +0200") References: <87v7yz1sw8.fsf@rutgers.edu> <87r09nwo6z.fsf@gmx.de> <8734lus43m.fsf@gmx.de> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Fri, 20 Sep 2024 13:11:49 -0400 Message-ID: <87tteaz1uy.fsf@rutgers.edu> Content-Type: text/plain X-ClientProxiedBy: BN6PR17CA0032.namprd17.prod.outlook.com (2603:10b6:405:75::21) To BL1PR14MB4856.namprd14.prod.outlook.com (2603:10b6:208:30a::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR14MB4856:EE_|SJ0PR14MB5275:EE_ X-MS-Office365-Filtering-Correlation-Id: 29c57943-a0f7-49b2-8f37-08dcd9975120 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tx3ec4BudCcLfYrBnrQu7HaZG1et1iJfc2Or6n9B+anxhlxNSDAC9rn/NIGW?= =?us-ascii?Q?gKR4DhKlzHGUFf38hR+z5gF/YvY7LuRq7rBPyK6S5u6VBzdYUYunc65565KK?= =?us-ascii?Q?S12IZriM3/2vTfQ5/ByNhHiMRewrxesTOyHIwC58v4bW3WXai2cB83WAlULy?= =?us-ascii?Q?YD551fUt7Y/0OUuvtdlzQds++3kOX8yFI4V2iDTfHlNUp6zLhnCxG9xsd1yv?= =?us-ascii?Q?K7oEZEvRpid9JvenlqpC6p1Y+xwwZg5K9Y/186R+6pzG4JzYr3YkMuNfzCHW?= =?us-ascii?Q?q727BDgGE6zcs+piWgFivlKPz7uQIWml+zCL9n+H15CC6gQJhWN8e8L9ELkW?= =?us-ascii?Q?GZS3+hI8fi6GiJUjzYP3KY++KQB5I8q9xNcjXGd29au4h5yKPVaTh73y8yKq?= =?us-ascii?Q?4zOVlg9MQCIdVMsBKwXPKx/WlkO2xZycMePqKK0IYznHjKleRYhDtnnRBmbJ?= =?us-ascii?Q?xbXTLp+lw474wFZ2tU3Raz60SFM9n20dEtISKcvj5+Fdias9uljjaKAYpiBz?= =?us-ascii?Q?LHDtU9eVvYqxlBEFdAbzEfp483vBYkXGpDbxYi6bwlvx7NXeJM+zIbwL0b2+?= =?us-ascii?Q?5jN4r3X7RbOQ/RX5KpVkDmhnm+Cy0p4apNBPbFQlwASVmsugJ5oKtSTkJ9+t?= =?us-ascii?Q?l7puQoBK7+knWvwPtAtavHOYCxDPy+BIVhKPPIqkoKsJNJg8zTiVttRDnsZR?= =?us-ascii?Q?7pSFcfiiac7koZgP5OOPHsPLVkXAWTwQw+52ZaYMphAO1QkNYjpggC+GIL5J?= =?us-ascii?Q?tpiXiliLtQzGJ5iMUU85KJfukmsAUamMwCMvliHcz16PgFzUlY8avKmEaA9G?= =?us-ascii?Q?4+0WVIemGGgCtd7I+mj+MBQcGmgH1yTJfs6B4OT+sEQdbqc2W+dA0oJYJU6B?= =?us-ascii?Q?ELBlhhXjogkPq3d9fUmYLewbnioZRwdlSZVxMPXk6hlRODpLhIg92PASfTp7?= =?us-ascii?Q?olqxjYwnxvtcIXYfNC9iIBKU4hszPojY4a9gMQQe04y/Oo+alzdsV2MXYlMe?= =?us-ascii?Q?tx2GsgqMIgXXAR6FtssgWeFkidORqgGGgQ5xjWtsF+g/iCIojYsqcx2nda3T?= =?us-ascii?Q?YpkyIduwYhOTLy+T4wBTTCanpyHTuqcapFcatWzjOygB4o4CyWg6WlsQ7L6F?= =?us-ascii?Q?EfD1XEIG9n7faQPIK5tq7i0ZQaIiiHvzR5aXA0WYL/ZgNj/rfssPFuKKGWmt?= =?us-ascii?Q?7c8o+4vVKXWuG9uw6ix0yXlR+E7PNfJQJx3uv6TtJXuGzom2PzW/diltfNLe?= =?us-ascii?Q?4aed6VkNTImFcow0auQaKhz/hOyLv6x0k46aVbJdRgqEi1mT6B3YExGpzkv/?= =?us-ascii?Q?cNfRC4UMWfri9GYiCAtW+PycLdtbbYcD0tz+EBm0KcNFz/SMf67mLO9N0KtW?= =?us-ascii?Q?f6iTIHsFapDvo1kxmcUuCvhuE/QQ6/6sM4YIOfs2bkZGDCs6BA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL1PR14MB4856.namprd14.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(52116014)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZE5j88r5/kfM51T6WqvDA+sHI+sG95OF9CjIhq3Slar+EORgXYvaQyhQShMV?= =?us-ascii?Q?jKnk2wJh4NkEnu40Gg2jMuiqNIQIBEsL5sW23KsqFSW3DS3fWfkK6opba8P3?= =?us-ascii?Q?WjLOkD989iSDEj3EZ5h+L441dYk/LeIXnG/cHSn/FXzFNemt/4tDKp0zJkNz?= =?us-ascii?Q?yiPqzh47YD72OfuLGcW+MoJaINHbDrsEw5ot2pdq+qMyO4pDhtxqNaAm3iUq?= =?us-ascii?Q?1goYLbDlsIK3j8+tkSR63qUBFRVrWxS0J53+Gven/J3ZhglQkoUSZqxggzH6?= =?us-ascii?Q?CKtLYNHZYr+XOU7hzShYyvBonJnAwjUCoiODLFC3Z+5EhYnwUd+X/reTeeWQ?= =?us-ascii?Q?0/zG3XfksTispoD2ScCxY0on7Jka8HsH67teiBkCga/qM2g4ZYWfp+/u4/In?= =?us-ascii?Q?JIw0XWCng1O9EXlvODD/KqSoR90mFuoSjHMNijU3V3vwTIaJZLebOXmpwolw?= =?us-ascii?Q?Q5WOd3DF5L552TphwDGL9cZ5x/ynQsqCumfm3GAsNA2VY9gOPYSNDCfPGv9M?= =?us-ascii?Q?fF9uxXQLI1zXnBeqVK4BEcfUpzHMQl3Q9PKDdu1bdIA5XrVfxqpyckLc6wij?= =?us-ascii?Q?Mi11fjkxr8cpjW2CEuIqKkblfT1u8V3TctM5mfxu8xrACFnKCqH8sRJ8JzJo?= =?us-ascii?Q?LnF8Nzm91ffv1HxJjylBEmxbfUfgY8+LopsvoBvHY8CHVGhmkGsW+DU3QW/Z?= =?us-ascii?Q?8T7Aim60tHLKgFNEVON87F+4nOxb1+Ngx1B9W5p2BkSdxhaOR4mPfP5arBDG?= =?us-ascii?Q?nN1VsnsY+1w81mZ1BSQGRpW+7CyIUX+ORPY9/hp7drMx9tX2ZBW5I7w47bUk?= =?us-ascii?Q?lbyuziFb+x11oK1IzmtdfT/LCt9zisWZ2OBtrT6PV8+C5DS11PSPM2KN4rWf?= =?us-ascii?Q?bADsV/DvftxL+svYF1coPlWDCKudTVDxmGasZjhVGvC5NKIh/5mkZbErz1ED?= =?us-ascii?Q?bUUiVHwmmYNL2FjINObeFh8gkOmZmC4sh/59GYm6mVSCBejoQPDh8jt00X03?= =?us-ascii?Q?UWHMn0UxgRtcx6Q3Ba/kuvngyFcqHRzAA2t07/4EMEF/WqaFNUk/Y/f8fAAU?= =?us-ascii?Q?LasEC7fGTdD5024SgeX3MvUU8YEi93/XueYPjio9FyT9ucG6foj0Atq/C6EO?= =?us-ascii?Q?f7N/OE1WgCvFTmllhO0znS5IpWN00VxhBMgCFKphz/dmOGzx5VLBZYJTXp+V?= =?us-ascii?Q?dre6SYBaZHpMMFAQDSmVt/3Q3AFPhCHWr/rPOEQnvrJ3B1qn/PXz4fP0WJDO?= =?us-ascii?Q?YhIsVH/rvTjQQSbo0T4+n7I744KhubdeVtQN7Cm45md4U8JxRIhkvWSZYdg9?= =?us-ascii?Q?g/qKi5ZLV3Bp0AqbJqn5bTlfbsLEQ1yE5cOGR8jDnf38BP6k1a0MzqI2gnbf?= =?us-ascii?Q?pfJJYfXUDQVARc3cnNws7y4OQWnLFA9MSDIYK9V9qomVUdyzjrymiELaoDYy?= =?us-ascii?Q?DfqAbabYil8658etxb/HmFvGQhhEUM89jsRc2362W1x0nq++kusSrnEgMZpg?= =?us-ascii?Q?TNZdNICVSWLwuCtWv+855rEPWlnxK88NxSGQ0bgwFWfzo7v7yWot9sbBtDAP?= =?us-ascii?Q?JT6g4sS0+JcYE4J4toJfcZOVvKWPCWvVNxckGJMY?= X-OriginatorOrg: rutgers.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 29c57943-a0f7-49b2-8f37-08dcd9975120 X-MS-Exchange-CrossTenant-AuthSource: BL1PR14MB4856.namprd14.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2024 17:11:50.8680 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b92d2b23-4d35-4470-93ff-69aca6632ffe X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SVp4/pwQ+truD4vmD3r89nt3bLjINmyI5/XK5NejZdKh7cO+aWnYPCj7CQ43uVQWLzuY59Tb/J0xfPbK6Jyzqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR14MB5275 X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I ran emacs -Q and the issue did not occur. Apologies for not checking with -Q that prior to reporting the issue. Thank you, Jake On Fri, Sep 20 2024, Michael Albinus wrote: Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.93.112 listed in wl.mailspike.net] 1.0 FORGED_SPF_HELO No description available. -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 73046 X-Mailman-Approved-At: Sat, 21 Sep 2024 00:07:17 -0400 Cc: 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) I ran emacs -Q and the issue did not occur. Apologies for not checking with -Q that prior to reporting the issue. Thank you, Jake On Fri, Sep 20 2024, Michael Albinus wrote: > Michael Albinus writes: > > Hi Jake, > >>> I had to revert 652a8a0838b38a6eab85c55fc61cedd1c61ef20f >>> >>> I could load a remote file with via tramp, but attempting to edit the >>> file spiked to 100% cpu usage and I had to C-g to recover. >> >> Could you, pls, reenable 652a8a0838b38a6eab85c55fc61cedd1c61ef20f >> temporarily? Then recompile Emacs, and run >> >> # emacs -Q -l tramp --eval '(setq tramp-verbose 10)' /ssh:some-host:/etc/somedir/file.yaml >> >> Try to edit the file. When the problem appears, return control by >> C-g. Show the resulting *debug tramp/ssh some-host* buffer. Likely, it >> is large; you could send it to me directly. > > Ping. Could you, pls, provide the needed information? Otherwise, we > cannot do anything for you. > >>> Thanks, >>> Jake > > Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 02:59:50 2024 Received: (at 73046) by debbugs.gnu.org; 21 Sep 2024 06:59:50 +0000 Received: from localhost ([127.0.0.1]:36953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sru5t-0002tv-SE for submit@debbugs.gnu.org; Sat, 21 Sep 2024 02:59:50 -0400 Received: from mout.gmx.net ([212.227.15.19]:46823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sru5q-0002tf-W5 for 73046@debbugs.gnu.org; Sat, 21 Sep 2024 02:59:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726901959; x=1727506759; i=michael.albinus@gmx.de; bh=zzva5Qc/1g/XOaaYwc325mJ8070ZTJKHFthm7azyvsE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=TXM4f8hgfNMUQ/+p5cshkWZYbv3rfqIcM16Lg38ul0UHApaJfQ+Qove4PBfJf6u0 dyk65IEz+oAZ3gZws+Xog7m5LlPadrASBVTqSTyAzJKl6fmdutNtoIrwc/2GuyjPs kKVVYEJryd2FLn5P9gNB6lPTHT6mQNCCqQVUt6/4CY18OAbWSYzlXIsODsbSR9SNB j4bkUgN3A351WEAydq65Qo0l3712pj4pKuK+PPZRk8BaEkWdnuqXVIw5A4LggRptv MKlFzv+2gcwjKKKaHS3sCIfoIOf+Ba9/H0atPhm0H6O/ucTjnJyyEBOs8eNnEPBxf euXxvQkBgnPN3soB1w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M3UZ6-1srLr31Qm2-00Btmp; Sat, 21 Sep 2024 08:59:19 +0200 From: Michael Albinus To: Jake Nelson Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87tteaz1uy.fsf@rutgers.edu> (Jake Nelson's message of "Fri, 20 Sep 2024 13:11:49 -0400") References: <87v7yz1sw8.fsf@rutgers.edu> <87r09nwo6z.fsf@gmx.de> <8734lus43m.fsf@gmx.de> <87tteaz1uy.fsf@rutgers.edu> Date: Sat, 21 Sep 2024 08:59:18 +0200 Message-ID: <87ploxqypl.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:jpAIcPYKLMBzJQvOAdsRidArsmCgBwym80tz0M8EW8LvnZgT3j3 nwd6tpLwnsB6zIBQcMCoAyR1ZHnQOoV6RqqeELbJkm7ZYZUQ22u2EkdaelNNv/zZUsnCH/K 1ygIpgguf98ObDvnqGOGr/8D1RcRsQPpoHQy0jdS1DtHTaKU0ZVldg+0AjLEDv7ggptFfg8 0AEx24umGzeb78xhdcT5w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ZcORGqep+kg=;kYRoC19FChRGZQW0Z16QllwQgWA j3ysthICt+Ibhoa6xdOw2UmuKMvIljDitIJRmueY4tEDu8CJiX9JpdKO0t99XScV9gq8SRSrm wFXZzobxbVcnVGpO10n7V3whNrMsDlAkacMwNro+eM84NCLny91R4cEpKpmI44F23+wJaUOMk 8OJh7zY3KoooLAzZ7STZsOlGXqBjvZBnV/Pnuh1s8mYeh2NqRlCcTMEQnJj7a20Kh3ajRLiPQ KF0FFZhZX2IcErw953oN1EiJA7YHA8y1aNLM/y9Hm2b+eZe23+w2HS58MQfU0zKiG41j0l+Ns VttHr8Gs1bQMz1dKOBKE+QDLQzskSCci+/khfwgIECRge2bU26P6xSfq4ij7Qtpy8ejo6cSpo CqR1kBpg4s53tRXhtoFb1HyfsrZvRYb3lWfkwWB+boJzci8g00V1BM9y/QvrhG2RBDcT2lXLw hO3r8NcR+H5kzKuzMailfpl+V8iJcuyAzbb2x+E02AzT7OelI5MTyMr+ye3SYj4S48bjkuE/a kh6lHyM4CrKjWjcM4YYtCY3QkudXbrUNeraN8lgwGLNaCv2TPp5BqG96SoGl8bhKJlw1+V668 NdWrA+XgEPafsCcUohelS78jdNxKwsEG/jHYS5k4pCVKbhyq3KvCwoVydFoveW02BRPR5r/ez lK5I81FD/szVDA78ZBZG1NG6TdLRs5gBzX/gKaepSArKourNAynEg95DeFVIl6sTyH7NX4ecq vLvQc06R2Sq9CT7VWrSHTH0OTwIrdo6GwCw1jUUoXS38NuL9P+WUnoxyQQBVI9a4/RzGbKKmJ nWgcvc8ZKURCJ3DGldjrm7kQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046 Cc: 73046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Jake Nelson writes: > I ran emacs -Q and the issue did not occur. Apologies for not checking > with -Q that prior to reporting the issue. Thanks for the feedback! > Thank you, > Jake Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 04:31:05 2024 Received: (at 73046-done) by debbugs.gnu.org; 21 Sep 2024 08:31:05 +0000 Received: from localhost ([127.0.0.1]:37045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srvWD-00083i-Bi for submit@debbugs.gnu.org; Sat, 21 Sep 2024 04:31:05 -0400 Received: from mout.gmx.net ([212.227.17.22]:56229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srvWA-000838-Gv for 73046-done@debbugs.gnu.org; Sat, 21 Sep 2024 04:31:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726907433; x=1727512233; i=michael.albinus@gmx.de; bh=dNbghZYooKjL+PdhrmbNV1OYdjB3d9NVx2kqG3H5hYA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=HO6vPy94YnRVbXS2GlJvbh3DHMg0Ct0N3tPvE4LNujMl9vtnT2BuzbQ66fiSOR3j CHb41gGeoWxnN+oMtVx3fBZOsVLVR2kx0PWmlqxLwltCkN19VT71wKujefm3vbtKq C2AG5eUnTMZJP+ofy8Uuo0jCzQAlWOm5MwLGHZXEhNlSZ41KDji3d6uWL6/sNj7jG /Yk+w4TAABebi16Fq7ITiXVQL5/lpZpvC1K6p93gmUUxURXw36aZhDt5MJxXv3qnQ R26Zea07DWt09uWJxjJEbHlAuPTqeD3HxuFASvJXom6eYgD9d27vPz6fP8EFp2sTI koB9elloLHyr4TsNrw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MfHEJ-1sKXty0xqN-00grGp; Sat, 21 Sep 2024 10:30:33 +0200 From: Michael Albinus To: Suhail Singh Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87cykys5gy.fsf@gmx.de> (Michael Albinus's message of "Fri, 20 Sep 2024 17:35:41 +0200") References: <87o75241qh.fsf@gmail.com> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87bk0ik5uz.fsf@gmx.de> <87zfo2jtnl.fsf@gmail.com> <87cykys5gy.fsf@gmx.de> Date: Sat, 21 Sep 2024 10:30:28 +0200 Message-ID: <87bk0hquhn.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Ei4usE0WXAakabBz/t32k9bQg7305iA8TuTuL95Rd24hC1nswQG DFWDyjguIY6JvoD8FFGU9MGd35p/7b/NEKYGaRpJYYPdRNk+INfKREVvWrUPG6hMAYJQXJ5 gRxAjsLvfSO1luBQ7rO8Kr4IoTwEm5FrgoYWkflDBs5i/mVQsr+fB1YbjVQz516NIMp0GlI P3nwvwKk1XHHrmGTWMXfw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:O/Y/2JK4/jw=;UzXgpxTsozAXNtEMVRwHIuhT3fo dL6H7v6aBJLt/sPBE8muBgACxLUgdr+nkNV5gfCO2/oUjKsSkKbWLg/1Di10bM7SVkEFIc7sM cVW8z8Sa3HD41Fj9gk6usKQon08othMgvPcDBl7Mj4QWJcQOT8wEbT+Y4qEzR3osyWlVhM8/Z mnGHn6Xbcm63JOuDDv5wxbT7BiMNh/G+RhogH808UchjR8wHzyvWN+SVxcHYT0eKxN+FQ8ZGN ln88Ztui+3jlxZsp5+6tQ/KfaaYrwMhEtBRukANg8403laSE0RA1bdd9dmZVh3+32eda61oA4 PklhK4/7Nv6cjYCAJBaXkRZDzB9yKFB5557nJREgTWMTCEzgbrJYtiV0hPSJwRS3zKRW6OaC8 IxZMMRVeBpLx+vm2Q2MzNHbygsWuvOl8xNbXvHD6p/eiFn5lIWS+5nJnMd0I11mkbrJ2FMQW9 +onATHDREKhjVXkYLiTCWqlHjIo+TQ/beRUAn6xTHegNYOQMs1i44TJrUqqBzQ4dpCzjHtfMJ VU03o2EZEeymCCzK2e/WUxu3SbG5hLhHu2MNcz/utNeZL3I0mJ5xEw+tTeg1+LGFsbgTjBcj4 TNReTe1Vl/SAKb+l1U5tqdjkk1gorU6BAYFUx5VnHKHrgmSIpE9+oR2ZgvhZhHpXCNLDyCGnh HzuG5fcfG3gsed44pTLcxGY/X4i5BgWK86TxDtcq2D6BbzUi0oYoDBfdNwFoLZh+Yc3FgSs68 fLExxY9um6sw/f6ROkOSVsIGu3mC1Wa2lE5wyyBNpG1ijpkzEoyQXuIrxR5imZT5BR1D62yNL 3suv/c/SdvnwIvlqrkAvNFxA== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73046-done Cc: 73046-done@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Version: 31.1 Michael Albinus writes: Hi Suhail, >> On a related, but distinct note, thoughts on whether there's a >> relatively straightforward way to address "3" below (from one of the >> other exchanges in this thread)? >> >>>> >> 3. If after invoking M-x we immediately start typing, the keyboard= input >>>> >> is registered, however, it doesn't display in the minibuffer ti= ll >>>> >> after the offending directory has finished font-locking. >>>> >> Additionally, doing so invariably results in 100% CPU usage for= the >>>> >> duration of the font-locking. Sometimes invoking M-x alone res= ults >>>> >> in CPU usage going back up to 100% (while font-locking is still= being >>>> >> done). >>>> >>>> > And what do you expect to happen when you press M-x while Emacs is >>>> > still busy performing your previous command? >>>> >>>> I did not expect 3 to happen. I.e., wrt 3 my expectation was that >>>> invoking M-x and typing doesn't result in a noticable increase in CPU >>>> usage for the duration of the font-locking. >>> >>> If 3 surprised you, then the reason is simple: sit-for returns >>> immediately if any input is available, so typing effectively disables >>> the wait. This could be countermanded by unconditional sleep, but >>> AFAIU Michael is rethinking the whole issue, so we should wait for him >>> to reach his conclusions. > > This would mean to use (sleep-for 0) instead of (sit-for 0), right? Hmm, > I might try the same tests for this clause next days, no idea whether it > makes a difference. > > But ATM, we should use (sit-for 0), until we know better. I've tried (sleep-for 0), but this doesn't help. CPU load is always 100%, even if there is no input. So I've pushed (sit-for 0) to master. Unless Eli has a better proposal, I'm done with this. It will also be available in Tramp 2.7.1.3, scheduled for release on GNU ELPA end of this month. Closing the bug. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 10:07:33 2024 Received: (at 73046-done) by debbugs.gnu.org; 21 Sep 2024 14:07:33 +0000 Received: from localhost ([127.0.0.1]:40080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss0lo-00022d-Uz for submit@debbugs.gnu.org; Sat, 21 Sep 2024 10:07:33 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:42418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss0lm-00022O-PJ for 73046-done@debbugs.gnu.org; Sat, 21 Sep 2024 10:07:31 -0400 Received: by mail-qv1-f66.google.com with SMTP id 6a1803df08f44-6c3552ce7faso25078626d6.1 for <73046-done@debbugs.gnu.org>; Sat, 21 Sep 2024 07:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726927564; x=1727532364; 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=8jUb8LXGsPtHuL442lTEsfo9uRj9ZIUO/le1LyYeGHs=; b=DrVzmFHW8YxyhruyR5gYXVNdK10uv07o6WyhC3bPN6QcK/6WYoqn9w3xCHImOkTKND AKfZqJpnuEzaNkxk6zicl7Mv6Jwcul5yaysFw67B+NiRtbaWCqh3yKvJoOUwrKX7eKgZ qdIJu/XdeMLdXBOywZ1zmPIwJ216bRFlY/jc85Zg671gtSpRxOE0CrqUw4lXXUJwNCiT 03Iy/SiL57M08L724QkVAx428+lgDZ+GbzI4/Ozbltx2jzNstZIX6khuB1aYC02avDbM KMZ2J10c0IUuhJoPJGFYoVO+68vZ6lwyVTdNSsX8p5d4ZlYR8jo/I8yEMsYoqXsvwMA6 ooVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726927564; x=1727532364; 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=8jUb8LXGsPtHuL442lTEsfo9uRj9ZIUO/le1LyYeGHs=; b=bfYf/WCyN8lDhmXK8uEhl0Efawkp1d7eSOLUaNvB3e2ALshIdrj6ASr6rzJX7pMiXr r12gZ6lAP3CIFUWhSC6bnaAY35rnIBOa0jJ4dwPURQd85puhhbS5pTdi14uAHA3AhB/d VaDHaS6cHzFiYHZlm0+pLiyjgVrMsUN7QSjG26iWPBX545ykwtB3gfWUZ9PmHUpuN7MG ha8WZDb6R4TQM9QjjvymV8MK0Hq71DzPRRZCevqCnuzwASQSxoCR0Bu1J8kTDZtt2Gkw MKWdVTPFx4y8vwPfyYounNYseYbO0LCaWarUuiVgCnBnsp1gijI/1j0oMNaZ1cBVVPUT ZtYg== X-Forwarded-Encrypted: i=1; AJvYcCUt9cINkyEtNkY7Pjpo11+j1DakU0WLpQWTDJFcflftI++0RGbJwOFhmqejs453Z+fOIKT4yDW2cLjv@debbugs.gnu.org X-Gm-Message-State: AOJu0YzeMDhCy0QFW9kSWXXZDUh4PyJlCNddlul99KHxDPZplHykjp2G OMsYPoaIgULNk802YHSzBljKAaTCojRdsqRfMbyy79b7wUyVcpcLEp08coFD X-Google-Smtp-Source: AGHT+IFCNo5ZKnKy/nlqJq2YLdZ3qjdRocUQkYB8dh6/EGApfnIqMfEcFYkohEux+yKmBRF6WAU/nQ== X-Received: by 2002:a05:6214:2d41:b0:6c3:5c75:d2b1 with SMTP id 6a1803df08f44-6c7bb99b4c3mr97025816d6.5.1726927564413; Sat, 21 Sep 2024 07:06:04 -0700 (PDT) Received: from gnus (bras-base-mtrlpq0776w-grc-23-65-94-70-53.dsl.bell.ca. [65.94.70.53]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c75e461437sm29034196d6.41.2024.09.21.07.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2024 07:06:03 -0700 (PDT) From: Suhail Singh To: Michael Albinus Subject: Re: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP In-Reply-To: <87bk0hquhn.fsf@gmx.de> (Michael Albinus's message of "Sat, 21 Sep 2024 10:30:28 +0200") References: <87o75241qh.fsf@gmail.com> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> <87wmjn2wq5.fsf@gmail.com> <87seuaids7.fsf@gmx.de> <86frqaweo2.fsf@gnu.org> <87a5gigo9b.fsf@gmx.de> <86cylew3tr.fsf@gnu.org> <87r09sexp0.fsf@gmx.de> <87cyl7rvn3.fsf@gmail.com> <86y13uiwhk.fsf@gnu.org> <877cbe48ja.fsf@gmail.com> <86ed5mffbc.fsf@gnu.org> <87bk0ik5uz.fsf@gmx.de> <87zfo2jtnl.fsf@gmail.com> <87cykys5gy.fsf@gmx.de> <87bk0hquhn.fsf@gmx.de> Date: Sat, 21 Sep 2024 10:06:02 -0400 Message-ID: <877cb5ayph.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 73046-done Cc: 73046-done@debbugs.gnu.org, Eli Zaretskii , Suhail Singh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Michael Albinus writes: > It will also be available in Tramp 2.7.1.3, scheduled for release on GNU > ELPA end of this month. > > Closing the bug. Much appreciated; thanks! -- Suhail From unknown Tue Jun 17 20:31:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 Oct 2024 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator