Subject: Re: bug#71355: 30.0.50; [PATCH] Improve performance of buffered output in Eshell

From: Jim Porter <[email-masked]>
Date: Thu, 6 Jun 2024 11:02:59 -0700

On 6/5/2024 9:43 PM, Eli Zaretskii wrote:
> 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.

For "cat" specifically, I think what we want is just to finish as fast 
as we can so that Eshell hands control back to the Emacs command loop, 
and then the user can start examining the output. (For example, by 
pressing C-c C-r to go to the beginning of the output, or using the 
"Smart" module[1].)

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

Agreed. I'd definitely like to improve the usability for dealing with 
long-running commands or ones that output a lot of text in Eshell. I 
think that's a separate task though. (For example, the text flashing 
before the user's eyes also happens when running the external 
/usr/bin/cat, and I haven't touched that code path here. A fix for that 
behavior would go elsewhere so that both the internal and external cats 
could benefit.)

[1] I don't use the Smart module so I don't know a ton about it, but it 
avoids scrolling the output as it comes in and stays at the beginning.