From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: Fix for slow process output processing (please test).
Date: 16 Dec 2003 14:24:17 +0100 [thread overview]
Message-ID: <m37k0wdhfi.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <x5oeu9m14e.fsf@lola.goethe.zz>
David.Kastrup@t-online.de (David Kastrup) writes:
> storm@cua.dk (Kim F. Storm) writes:
>
> > So if you have a process which manages to write a lot of data in one
> > write, emacs should happily read that data with no throttling.
>
> And if we have a process that writes in small chunks but with very
> good CPU utilization (something like dd if=/dev/zero obs=1), then we
> will alternate between reading 8192 (or whatever the pipe size is) and
> 1 byte. Of course vastly preferable to alternating between reading 1
> byte and 1 byte.
The following small change to the previous patch makes the patched
process.c run even faster:
Replace the line
delay += READ_OUTPUT_DELAY_INCREMENT;
by
delay += READ_OUTPUT_DELAY_INCREMENT * 2;
If I run your own "M-x make-test" command with the patched version of
process.c on GNU/Linux, I get the following measurements:
102400+0 records in
102400+0 records out
finished
Time: 0
1 blocks with size 1
1 blocks with size 137
19 blocks with size 1023
61 blocks with size 1024
Time: 1
1 blocks with size 950
4 blocks with size 1023
15 blocks with size 1024
Compare this to the results from the unpatched process.c:
102400+0 records in
102400+0 records out
finished
Time: 0
311 blocks with size 1
1 blocks with size 1023
3 blocks with size 1024
Time: 1
185 blocks with size 1
Time: 2
231 blocks with size 1
Time: 3
191 blocks with size 1
2 blocks with size 1023
6 blocks with size 1024
Time: 4
113 blocks with size 1
9 blocks with size 1023
27 blocks with size 1024
Time: 5
108 blocks with size 1
8 blocks with size 1023
24 blocks with size 1024
Time: 6
62 blocks with size 1
1 blocks with size 912
4 blocks with size 1023
14 blocks with size 1024
Pretty good improvement IMHO.
Of course, if you have examples of things that behave badly with the
patched version (i.e. that ran better without the patch), I'd like to
know.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
next prev parent reply other threads:[~2003-12-16 13:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-16 1:21 Fix for slow process output processing (please test) Kim F. Storm
2003-12-16 2:14 ` David Kastrup
2003-12-16 3:34 ` David Kastrup
2003-12-16 10:23 ` Kim F. Storm
2003-12-16 11:51 ` David Kastrup
2003-12-16 13:24 ` Kim F. Storm [this message]
2004-01-03 15:12 ` David Kastrup
2004-01-04 23:00 ` Kim F. Storm
2004-01-03 22:07 ` Eric Hanchrow
2004-01-04 22:42 ` Kim F. Storm
2004-01-05 15:57 ` David Kastrup
2004-01-05 19:09 ` Eli Zaretskii
2004-01-05 19:39 ` David Kastrup
2004-01-05 19:52 ` Jason Rumney
2004-01-05 23:28 ` Kim F. Storm
2004-01-05 23:16 ` Jason Rumney
2004-01-05 23:44 ` David Kastrup
2004-01-06 0:23 ` Jason Rumney
2004-01-07 0:40 ` Kim F. Storm
2004-01-05 23:35 ` Kim F. Storm
2004-01-05 22:50 ` David Kastrup
2004-01-06 0:09 ` Kim F. Storm
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=m37k0wdhfi.fsf@kfs-l.imdomain.dk \
--to=storm@cua.dk \
--cc=emacs-devel@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 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.