Subject: Re: bug#18626: 24.3.94; communication with subprocess is slow

From: Stephen Leake <[email-masked]>
Date: Fri, 10 Oct 2014 03:47:12 -0500

There remains a problem on Linux; with either a pty or a pipe, there is
a default internal buffer of 2^16 bytes, which means we encounter the
send_process EWOULDBLOCK delay of 20 ms for every 2^16 bytes; that takes
0.3 seconds for 1 megabyte:

(find-file "xdisp.c")
(pipe-torture
"/home/Projects/org.emacs.ada-mode.stephe-1/build/wisi/debug_counted"
"974233" "974233")
send time 0.291322

The pipe is created by emacs_pipe in sysdep.c; there is no parameter for
the internal buffer size.

The pty is created by allocate_pty in process.c; I don't see a size
parameter there, but there are lots of macros.

However, changing the value for the nsecs parameter in the call to
wait_reading_process_output in send_process at process.c:4282 has no
effect, so the 20 ms delay is coming from something else.

-- 
-- Stephe