all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18626@debbugs.gnu.org
Subject: bug#18626: 24.3.94; communication with subprocess is slow
Date: Sun, 05 Oct 2014 13:19:18 -0500	[thread overview]
Message-ID: <85vbnycrbt.fsf@stephe-leake.org> (raw)
In-Reply-To: <831tqmo9v4.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 Oct 2014 17:43:27 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stephen Leake <stephen_leake@stephe-leake.org>
>> Cc: 18626@debbugs.gnu.org
>> Date: Sun, 05 Oct 2014 08:41:08 -0500
>> 
>> (find-file "xdisp.c")
>> (pipe-torture
>> "/home/Projects/org.emacs.ada-mode.stephe-1/build/wisi/debug_counted"
>> "4096" "974230")
>> 
>> 0.344027
>> 
>> This is comparable to the time on Windows with a large buffer in the
>> subprocess. So apparently it is not using the same delay in
>> send_process. Or the IO system is providing a large buffer.
>
> Evidently, subprocess I/O is more efficient on GNU/Linux than it is on
> Windows.  Perhaps this is related to the fact that by default
> GNU/Linux uses PTYs for that, not pipes.  Did you try your experiments
> with process-connection-type bound to nil?

On Debian:

(setq process-connection-type nil)

(pipe-torture-read "/home/Projects/emacs/emacs-24.3.94/src/xdisp.c")
0.074980

no signficant change

(find-file "xdisp.c")
(pipe-torture
"/home/Projects/org.emacs.ada-mode.stephe-1/build/wisi/debug_counted"
"4096" "974230")

0.294485, 0.304046,  0.343767

(pipe-torture
"/home/Projects/org.emacs.ada-mode.stephe-1/build/wisi/debug_counted"
"40000" "974230")
0.341241, 0.342165

Slower than pty, but much faster than Windows, and still independent of
subprocess read buffer size.


(setq process-connection-type nil) also eliminates the line-by-line
read; for a buffer size of 4096, Read returns 4096 until the end of the
text. For a buffer size of 40000, Read returns 40000 or 25536 until the
end of the text. (+ 40000 25536) = 65536, which makes sense for the
default pipe buffer size.

Given a send_process delay of 0.020 on EWOULD_BLOCK, and a buffer size
of 65536, the expected write time is (* 0.020 (/ 974230 65536)) = 0.28,
comparable to what we see.

Apparently pty's do the line by line send. Which makes sense for a
"psuedo-terminal". And they also apparently use a larger internal
buffer. 

-- 
-- Stephe





  reply	other threads:[~2014-10-05 18:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04  6:47 bug#18626: 24.3.94; communication with subprocess is slow stephen_leake
2014-10-04  8:07 ` Eli Zaretskii
2014-10-05 13:20   ` Stephen Leake
2014-10-05 13:41     ` Stephen Leake
2014-10-05 14:43       ` Eli Zaretskii
2014-10-05 18:19         ` Stephen Leake [this message]
2014-10-04  8:11 ` Stephen Leake
2014-10-04  8:32   ` Eli Zaretskii
2014-10-04 22:29     ` Stefan Monnier
2014-10-05  2:46       ` Eli Zaretskii
2014-10-05 13:34     ` Stephen Leake
2014-10-05 14:40       ` Eli Zaretskii
2014-10-05 18:25         ` Stephen Leake
2014-10-05 19:04           ` Eli Zaretskii
2014-10-08 13:29           ` Stephen Leake
2014-10-08 13:53             ` Eli Zaretskii
2014-10-10  8:07               ` Stephen Leake
2014-10-10  9:13                 ` Eli Zaretskii
2014-10-10  8:47           ` Stephen Leake

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=85vbnycrbt.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=18626@debbugs.gnu.org \
    --cc=eliz@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.