all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 71355@debbugs.gnu.org, stefankangas@gmail.com
Subject: bug#71355: 30.0.50; [PATCH] Improve performance of buffered output in Eshell
Date: Thu, 06 Jun 2024 07:43:58 +0300	[thread overview]
Message-ID: <86r0daistt.fsf@gnu.org> (raw)
In-Reply-To: <7f6b9173-e16f-c65d-8758-8ca7098876b7@gmail.com> (message from Jim Porter on Wed, 5 Jun 2024 13:07:48 -0700)

> Date: Wed, 5 Jun 2024 13:07:48 -0700
> Cc: 71355@debbugs.gnu.org, stefankangas@gmail.com
> From: Jim Porter <jporterbugs@gmail.com>
> 
> 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.)

My main point is that 'cat' is used to show the contents of a file to
the user, so the assumption is that the user _wants_ to see that
stuff.  So having the stuff flash before user's eyes in an instant is
not necessarily the best idea, even though it is faster, and thus
performance-wise we win.

If the above is agreed, and you still think 2K characters is the best
default value, I'm fine with that.





  reply	other threads:[~2024-06-06  4:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04  5:36 bug#71355: 30.0.50; [PATCH] Improve performance of buffered output in Eshell Jim Porter
2024-06-04 21:52 ` Stefan Kangas
2024-06-05  1:55   ` Jim Porter
2024-06-05  3:50     ` Jim Porter
2024-06-05 12:06       ` Eli Zaretskii
2024-06-05 16:42         ` Jim Porter
2024-06-05 16:51           ` Eli Zaretskii
2024-06-05 17:35             ` Jim Porter
2024-06-05 17:57               ` Eli Zaretskii
2024-06-05 18:47                 ` Jim Porter
2024-06-05 18:58                   ` Eli Zaretskii
2024-06-05 20:07                     ` Jim Porter
2024-06-06  4:43                       ` Eli Zaretskii [this message]
2024-06-06 18:02                         ` Jim Porter
2024-06-08  4:25                           ` Jim Porter
2024-06-08  7:33                             ` Stefan Kangas
2024-06-08 19:43                               ` Jim Porter
2024-06-06  9:20     ` Stefan Kangas
2024-06-06 18:04       ` Jim Porter
2024-06-06 23:14     ` Stefan Kangas
2024-06-07  0:09       ` Jim Porter
2024-06-07  8:51         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86r0daistt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71355@debbugs.gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.