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: Tue, 10 Sep 2024 21:05:29 -0400 Message-ID: <87plpb6luu.fsf@gmail.com> References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> <87h6asrk42.fsf@gmx.de> <86a5gk28ht.fsf@gnu.org> <87le0450x8.fsf@gmx.de> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8123"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , suhailsingh247@gmail.com, 73046@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 11 03:07:20 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 1soBpG-0001yQ-Tf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Sep 2024 03:07:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soBox-0005LE-Hb; Tue, 10 Sep 2024 21:06:59 -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 1soBov-0005L2-Gv for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2024 21:06:57 -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 1soBov-0000gN-5w for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2024 21:06:57 -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=jIROTQH6dxVQ9yPzyx1SeWTQnATf7ZI7vCzunyi0P9k=; b=ls9E2PgwVsi4aF+z0nnJ6k1NmQZR/banseRhfUjF1i0vN9iJC30zz7daOZdZFeh2XCcMuOYhModSVm4ZCZJqHhQDKW10tOHvq/7devxAFR2Cu3ceKniFcskFSZ2A8rsYrXSZkH1Dg7/J2KgOR0uCXHTbGOzK13dINfDnmqMcPEBJoux0f8OmwqVhQOTETHQkCpjyiL8eZ2aw4xJefr7qTKGNQL/SByI6zehXOhmGrO/P9QWqzTeDep+lzU0unXKIlW+d4VTNNZ8MglBRkcxMpKlYxHwSwZrpSySuJ4imImHSPfXdRD5kXFp0kvD9uhwYAu2uYE0dpIfmQp6l+pHWdw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1soBp0-0006Pu-7r for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2024 21:07: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: Wed, 11 Sep 2024 01:07: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.172601681424654 (code B ref 73046); Wed, 11 Sep 2024 01:07:02 +0000 Original-Received: (at 73046) by debbugs.gnu.org; 11 Sep 2024 01:06:54 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <87r09sexp0.fsf@gmx.de> (Michael Albinus's message of "Tue, 10 Sep 2024 10:10:19 +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:291582 Archived-At: 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