From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#71355: 30.0.50; [PATCH] Improve performance of buffered output in Eshell Date: Wed, 5 Jun 2024 13:07:48 -0700 Message-ID: <7f6b9173-e16f-c65d-8758-8ca7098876b7@gmail.com> References: <22b0dc8f-11dc-5fd2-c75d-88c17580d28d@gmail.com> <848772e9-5ef0-8a8a-decd-c0b79366ec27@gmail.com> <86ikynk30i.fsf@gnu.org> <037ebce9-93af-f1ad-67d9-550fd1074294@gmail.com> <8634prjpt0.fsf@gnu.org> <9da5a395-48e8-fb20-145b-1d2581315fcf@gmail.com> <86y17ji860.fsf@gnu.org> <86v82ni5dd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32503"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71355@debbugs.gnu.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 05 22:11:06 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 1sEwyQ-0008BL-J8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Jun 2024 22:11:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEwyB-0002LY-3s; Wed, 05 Jun 2024 16:10:51 -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 1sEwy9-0002Kg-5w for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 16:10:49 -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 1sEwy8-00050W-IC for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 16:10:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEwyM-0008CF-CM for bug-gnu-emacs@gnu.org; Wed, 05 Jun 2024 16:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Jun 2024 20:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71355 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71355-submit@debbugs.gnu.org id=B71355.171761822031389 (code B ref 71355); Wed, 05 Jun 2024 20:11:02 +0000 Original-Received: (at 71355) by debbugs.gnu.org; 5 Jun 2024 20:10:20 +0000 Original-Received: from localhost ([127.0.0.1]:34258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEwxb-0008A0-VR for submit@debbugs.gnu.org; Wed, 05 Jun 2024 16:10:20 -0400 Original-Received: from mail-pf1-f176.google.com ([209.85.210.176]:49395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEwwY-00086w-Lr for 71355@debbugs.gnu.org; Wed, 05 Jun 2024 16:09:16 -0400 Original-Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-702342c60dfso146087b3a.2 for <71355@debbugs.gnu.org>; Wed, 05 Jun 2024 13:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717618070; x=1718222870; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=vomMAQBV4HgTpjArwVRNh7ba5vd2aJXAg8cZv5+CW/k=; b=HOyxogd1vBKgxZmAPyQh7rINgUqiyUtQn235mYePGS4J0+qC5GbgmOmcdzmaMl3fI/ mjPIRn4LNnBK3BxF4lxZZe3BKkNVhuTUuPBv9rJGX34dQ1fM6wbRMk5gYoCKQhUuJfiW OWiIZau7fkMLeLxV0yuW5Jj+IvuEN4k6oiTbCg6ehXnB++xg2PIVliilt6z8Ee8CCrbN 18nk8RWoo07idNbLfam3Tz23y6pmM+F4lBEsYJezrgimhZHQt3DdVLeAUHDFQQlINIiQ vAZXu4JESqkxSIWKaYGovy0RBDV/F7iQR3L/lXCdJIeBPeBnZFeCzV36emWTD4BKw6lR T8bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717618070; x=1718222870; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vomMAQBV4HgTpjArwVRNh7ba5vd2aJXAg8cZv5+CW/k=; b=MfWlAVEO6NdBGwMr1YC0TgKVXnbbsBIG5pYulxch9+4i3+HUVXHnwoP//v29GfQA0V v9VjmFqjTdg9cG/0smOmg+0rIaR6d+89QBwtkZcxAT3Eo+gtpljNey5UpMcjF3NCFoLh m9tvYTs5ZTVmWjrEaL6/hxE8xkCPSJ0gJS5FKK8KsHtzahJ2XDIEXN3EswAr0o3s4JxH jamu+bza2jyuWHVklWix46sNVNuQZveV/uaLRwOrJwln3WS6Spu46WRhwM/6N+c/uOS5 z4tCjYy/tfDZ7FjxhCPG9ykmxkx0B6+UodXlr4QSmX9laJSeOR3OQcdOevG8xMnneXjG dlLQ== X-Gm-Message-State: AOJu0YwRw3TyUg1gbP8wcwgu7cNnFiShJGGYZSdISdOdbLrSuhQYZSiN q8lR6t45DsMsMSaTlNIZuda5fJ4oxEphRQdgDfACwGdeQelMUE/d X-Google-Smtp-Source: AGHT+IGr8DK2ih7B8Szac7b7qNQMMdjJBSCpXymzLiqjCyc08q3/RZhe+kGn901Lk/+j+0fIERY+Zw== X-Received: by 2002:a05:6a00:1acb:b0:701:e698:7c12 with SMTP id d2e1a72fcca58-703e593d245mr4173454b3a.5.1717618070397; Wed, 05 Jun 2024 13:07:50 -0700 (PDT) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-702657f7ccbsm5809711b3a.116.2024.06.05.13.07.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Jun 2024 13:07:49 -0700 (PDT) Content-Language: en-US In-Reply-To: <86v82ni5dd.fsf@gnu.org> 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:286640 Archived-At: On 6/5/2024 11:58 AM, Eli Zaretskii wrote: > So now that we agree about this aspect, I ask again: wouldn't it make > sense to show the text to the user in smaller chunks? 2K characters > is 2 dozen lines, and I expect users to be somewhat unhappy about > being presented the text in such large chunks. That's now what they > see when invoking 'cat' from the shell prompt outside Emacs. Ok, I see what you mean. I think the thing users would be unhappy about is "long" periods of time between display updates. (If we flush and/or redisplay faster than the user's monitor refreshes, those updates are wasted.) For the kinds of output that Eshell's buffered-print is designed for, we can get the text we want to print very quickly, so even with a buffer size of 2048, we flush more than 60 times a second (testing with "cat" and "ls" on a spinny disk). In situations where the buffering caused unacceptable delays, a command would either a) not use buffered output or b) manually flush at opportune times. I'm not sure those would come up in practice though. Ultimately, in the cases where Eshell does buffered-printing now, the thing that limits the user seeing updates is the redisplay throttle, not the buffer size. A smarter version of 'eshell-buffered-print' could flush before the buffer was full if enough time has passed, but that would add complexity without a lot of immediate benefit. (For example, would we set up a timer to flush? I'm not sure how that would interact with the rest of this code, which is all synchronous.)