all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Fixxed buffer size for eshell
@ 2017-04-30 10:02 Anast Gramm
  2017-04-30 14:21 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Anast Gramm @ 2017-04-30 10:02 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I am using eshell to compile and test my projects.

When I run a build command eshell gets filled with thousands of lines
with the compiler commands.

This results in a huge buffer (>10mb) thus slowing down emacs.

As a workaround I use the clear function copied straight out of
the emacsdev mailing list [1].

This is not ideal, since I use it after the buffer is filled, and emacs
is already slow at that point.

What I want is a fixed buffer size, like in normal terminals where
you have a set amount of lines.
I'd like something like (setq eshell-max-lines 1000) so when the output reaches
line 1000 the next like is inserted while the first one is deleted and so on...

Does this exist? If not, how would one go to implement such a feature?


[1]: http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00176.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fixxed buffer size for eshell
  2017-04-30 10:02 Fixxed buffer size for eshell Anast Gramm
@ 2017-04-30 14:21 ` Eli Zaretskii
  2017-04-30 18:37   ` Anast Gramm
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-04-30 14:21 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 30 Apr 2017 13:02:52 +0300
> From: Anast Gramm <anastasis.gramm2@gmail.com>
> 
> When I run a build command eshell gets filled with thousands of lines
> with the compiler commands.
> 
> This results in a huge buffer (>10mb) thus slowing down emacs.

Large buffers shouldn't slow down Emacs.  They don't here.  And 10MB
is not large by today's standards anyway.

Can you show a recipe for reproducing the problem?

Also, what Emacs version is that?

> As a workaround I use the clear function copied straight out of
> the emacsdev mailing list [1].
> 
> This is not ideal, since I use it after the buffer is filled, and emacs
> is already slow at that point.
> 
> What I want is a fixed buffer size, like in normal terminals where
> you have a set amount of lines.

You could write a function that removes old lines, and have it on
post-command-hook.  But you shouldn't need something like that, so I
think you should report a bug and let the Emacs developers fix it or
tell you how to avoid the slowdown in a more elegant way.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fixxed buffer size for eshell
  2017-04-30 14:21 ` Eli Zaretskii
@ 2017-04-30 18:37   ` Anast Gramm
  2017-04-30 19:21     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Anast Gramm @ 2017-04-30 18:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Sun, Apr 30, 2017 at 05:21:51PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 30 Apr 2017 13:02:52 +0300
> > From: Anast Gramm <anastasis.gramm2@gmail.com>
> > 
> > When I run a build command eshell gets filled with thousands of lines
> > with the compiler commands.
> > 
> > This results in a huge buffer (>10mb) thus slowing down emacs.
> 
> Large buffers shouldn't slow down Emacs.  They don't here.  And 10MB
> is not large by today's standards anyway.
Actually it's 10mb for every time I run the afformentioned commands,
so it gets big fast.
> 
> Can you show a recipe for reproducing the problem?
An example is when I print the contents of a binary file using
a C++ program, and that file is big, eshell buffer gets ~50000 lines
at that point stuff moves slower for a while.

Compared to urxvt, when I print the file there, when the command finish
its just like a simple ls.
> 
> Also, what Emacs version is that?
Emacs 25.1.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fixxed buffer size for eshell
  2017-04-30 18:37   ` Anast Gramm
@ 2017-04-30 19:21     ` Eli Zaretskii
  2017-05-01 12:15       ` Anast Gramm
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-04-30 19:21 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 30 Apr 2017 21:37:46 +0300
> From: Anast Gramm <anastasis.gramm2@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> 
> On Sun, Apr 30, 2017 at 05:21:51PM +0300, Eli Zaretskii wrote:
> > > Date: Sun, 30 Apr 2017 13:02:52 +0300
> > > From: Anast Gramm <anastasis.gramm2@gmail.com>
> > > 
> > > When I run a build command eshell gets filled with thousands of lines
> > > with the compiler commands.
> > > 
> > > This results in a huge buffer (>10mb) thus slowing down emacs.
> > 
> > Large buffers shouldn't slow down Emacs.  They don't here.  And 10MB
> > is not large by today's standards anyway.
> Actually it's 10mb for every time I run the afformentioned commands,
> so it gets big fast.

OK, but that's still not large.  When you get around 1GB, that will be
large.

> > Can you show a recipe for reproducing the problem?
> An example is when I print the contents of a binary file using
> a C++ program, and that file is big, eshell buffer gets ~50000 lines
> at that point stuff moves slower for a while.

All I can say is that I cannot reproduce this here.  I've ran this
command

  $ od prog

where prog is a 13MB executable program.  That filled the Eshell
buffer with 190,000 lines, and I still didn't see any slowdown.  Not
sure why you do see Emacs getting slower (I tried C-b and C-p).  Is
this similar to what you do in your case?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fixxed buffer size for eshell
  2017-04-30 19:21     ` Eli Zaretskii
@ 2017-05-01 12:15       ` Anast Gramm
  2017-05-01 14:26         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Anast Gramm @ 2017-05-01 12:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Sun, Apr 30, 2017 at 10:21:03PM +0300, Eli Zaretskii wrote:
> All I can say is that I cannot reproduce this here.  I've ran this
> command
> 
>   $ od prog
> 
> where prog is a 13MB executable program.  That filled the Eshell
> buffer with 190,000 lines, and I still didn't see any slowdown.  Not
> sure why you do see Emacs getting slower (I tried C-b and C-p).  Is
> this similar to what you do in your case?

Ok, I just run

od /bin/mixxx in eshell.

( mixxx is 11.6 MB binary and od /bin/mixxx | wc -l gave me ~750000 lines )

Emacs freezes when the buffer is at ~6500 lines,
the whole daemon stoped so I had to restart it to write this email.
MPD started glitching the music that was on, and firefox crashed.
Also my network manager restarted at that point.

I managed to open a terminal and type pkill emacs, and everything went back
to normal.

Is it possible that memory depletion is causing this? I got 8gb...

P.S. when I run the same command in urxvt it just prints out the octals
for a while without a single hint of lag anywhere on the pc.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fixxed buffer size for eshell
  2017-05-01 12:15       ` Anast Gramm
@ 2017-05-01 14:26         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-05-01 14:26 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 1 May 2017 15:15:45 +0300
> From: Anast Gramm <anastasis.gramm2@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> 
> On Sun, Apr 30, 2017 at 10:21:03PM +0300, Eli Zaretskii wrote:
> > All I can say is that I cannot reproduce this here.  I've ran this
> > command
> > 
> >   $ od prog
> > 
> > where prog is a 13MB executable program.  That filled the Eshell
> > buffer with 190,000 lines, and I still didn't see any slowdown.  Not
> > sure why you do see Emacs getting slower (I tried C-b and C-p).  Is
> > this similar to what you do in your case?
> 
> Ok, I just run
> 
> od /bin/mixxx in eshell.
> 
> ( mixxx is 11.6 MB binary and od /bin/mixxx | wc -l gave me ~750000 lines )
> 
> Emacs freezes when the buffer is at ~6500 lines,
> the whole daemon stoped so I had to restart it to write this email.

That's nowhere near what I see here.  Some factor must be at work
here, but I have no idea what that could be.

> MPD started glitching the music that was on, and firefox crashed.
> Also my network manager restarted at that point.
> 
> I managed to open a terminal and type pkill emacs, and everything went back
> to normal.
> 
> Is it possible that memory depletion is causing this? I got 8gb...

Unlikely: my testing was on a 4GB machine.

But it's possible that your settings of virtual memory are
sub-optimal.  Did Emacs start paging just before it froze?  What does
the 'free' command displays on your system?



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-01 14:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-30 10:02 Fixxed buffer size for eshell Anast Gramm
2017-04-30 14:21 ` Eli Zaretskii
2017-04-30 18:37   ` Anast Gramm
2017-04-30 19:21     ` Eli Zaretskii
2017-05-01 12:15       ` Anast Gramm
2017-05-01 14:26         ` Eli Zaretskii

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.