From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Suhail Singh Newsgroups: gmane.emacs.bugs Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP Date: Fri, 20 Sep 2024 10:18:06 -0400 Message-ID: <87zfo2jtnl.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9889"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Suhail Singh , 73046@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 20 16:20:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sreUU-0002Qt-8H for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Sep 2024 16:20:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sreU5-00076r-7m; Fri, 20 Sep 2024 10:19:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sreU3-00076e-K6 for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 10:19:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sreU3-0005B5-BE for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 10:19:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=h2jQlOMhH6ik3liYsOmsLAKsZOLggAvDO7qicG2h8Bg=; b=G2jWJnMC7Jmo718+KIqpUT2J1XJvWfN48gb/zhMwmenZINkjLdHgtruLkA6zy5xTHskJ/+7UloMTWsbW9SQnb13O0j5LrnW/E1q4/JM4tpEkW+dxc/YLKPEO8r1HD0UFNTqr3L1/wTEWGAZGOXtATdiUm0MzsE4xsGT0i0jM66uBicT7MlV9Hdl8QOaCaDdtpl5SVXf+gWTsbHQADTw+lPwtzgc/ESHdCaXoifTKjfchrFAaychrYTYbwgzI0ieH4g8uTvp53Tf+V3KVdAu+6+cST+K8FuBqqz85rrgiu/87S7D0UGnkxDUQ29iPWV6WXm9UDhfNxH9EIk37NsxhLQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sreUM-0005ll-5c for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 10:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Suhail Singh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2024 14:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73046 X-GNU-PR-Package: emacs Original-Received: via spool by 73046-submit@debbugs.gnu.org id=B73046.172684198722148 (code B ref 73046); Fri, 20 Sep 2024 14:20:02 +0000 Original-Received: (at 73046) by debbugs.gnu.org; 20 Sep 2024 14:19:47 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <87bk0ik5uz.fsf@gmx.de> (Michael Albinus's message of "Fri, 20 Sep 2024 11:54:28 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292122 Archived-At: 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