unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David.Kastrup@t-online.de (David Kastrup)
Subject: Re: Any idea about what makes Emacs slow reading on pipes?
Date: 18 May 2003 12:12:54 +0200	[thread overview]
Message-ID: <x565o84l7d.fsf@lola.goethe.zz> (raw)
In-Reply-To: <84smrcskwu.fsf@lucy.is.informatik.uni-duisburg.de>

kai.grossjohann@gmx.net (Kai Großjohann) writes:

> David.Kastrup@t-online.de (David Kastrup) writes:
> 
> > So what can we do about this?
> >
> > a) use only SMP systems
> > b) pester Linux developers to be less eager with context switches on
> >    select.  I am trying this course now, but it will of course take
> >    time to register and other OS might have similar problems
> > c) make a super-efficient path for process output arriving in tiny
> >    chunks, since this is what we will be force-fed most of the time.
> 
> I wonder if the invocation of the process filter function could be
> optimized.
> 
> Idea: the current situation might be this: when Emacs gets stuff from
> a process, it reads the data, stashes it somewhere in a buffer, then
> invokes the process filter function on the stashed-away stuff.
> 
> We might change it so that, after stashing the stuff in a buffer,
> Emacs looks again if more data is available from the same process.

The data will not become available unless the process gets the CPU
time to produce it, and we can't persuade the operating system to
give the process the CPU time unless we yield the CPU.  The solution,
as explained elsewhere, is to throttle the calls to the process
filter function and actively delay processing if we find ourselves
processing small packets at a high rate.

> That way, Emacs might continue reading stuff from the process until
> the process has nothing to produce.

Well, people always complain about Emacs being an operating system,
not an editor, but scheduling processes is not yet its responsibility.
I just propose that we help out the operating system in its scheduling
a bit...  since the bad consequences occur on our side of the
equation, we should do what we can reasonable do to avoid them even
where, strictly speaking, the OS is to blame for assuming that Emacs
will be happier with many small packets instead of a few large ones.

But the "slow start xterm" effect, where the performance of an xterm
with

od -v /dev/zero|dd obs=1

gets much faster if you start

while true;do :;done

in a separate term is very common on single-processor machines.  I
always found it curious and never thought about it further.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2003-05-18 10:12 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-16 13:08 Any idea about what makes Emacs slow reading on pipes? David Kastrup
2003-05-16 13:55 ` Andreas Schwab
2003-05-16 17:18 ` Kevin Rodgers
2003-05-16 17:34   ` David Kastrup
2003-05-16 18:38     ` Kevin Rodgers
2003-05-16 18:49       ` David Kastrup
2003-05-16 17:48 ` Jan D.
2003-05-16 18:38   ` David Kastrup
2003-05-16 20:23     ` Jan D.
2003-05-16 21:00     ` Andreas Schwab
2003-05-16 23:17     ` Satyaki Das
2003-05-17  1:50     ` Kim F. Storm
2003-05-17  0:34       ` David Kastrup
2003-05-18  0:31         ` Kim F. Storm
2003-05-17 23:07           ` Stefan Monnier
2003-05-17 23:39           ` David Kastrup
2003-05-18  2:09             ` Stefan Monnier
2003-05-18  8:45             ` Kai Großjohann
2003-05-18 10:12               ` David Kastrup [this message]
2003-05-18 19:04               ` Richard Stallman
2003-05-18 19:46                 ` David Kastrup
2003-05-19  7:33                   ` Kai Großjohann
2003-05-19  8:24                     ` David Kastrup
2003-05-18  8:46             ` Kai Großjohann
2003-05-18 10:03               ` David Kastrup
2003-05-18 15:09                 ` Kai Großjohann
2003-05-18 15:36                   ` David Kastrup
2003-05-18 15:50                     ` Kai Großjohann
2003-05-18 16:28                       ` David Kastrup
2003-05-19  7:26                         ` Kai Großjohann
2003-05-19  8:09                           ` David Kastrup
2003-05-18 19:03           ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=x565o84l7d.fsf@lola.goethe.zz \
    --to=david.kastrup@t-online.de \
    --cc=dak@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).