From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.bugs Subject: bug#18626: 24.3.94; communication with subprocess is slow Date: Sat, 04 Oct 2014 03:11:26 -0500 Message-ID: <85d2a8dzkh.fsf@stephe-leake.org> References: <85wq8ge3gr.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412410350 7600 80.91.229.3 (4 Oct 2014 08:12:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Oct 2014 08:12:30 +0000 (UTC) To: 18626@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 04 10:12:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XaKRy-0000sZ-CL for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Oct 2014 10:12:22 +0200 Original-Received: from localhost ([::1]:42922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaKRx-0004GG-LJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Oct 2014 04:12:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaKRm-0004Fz-TS for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2014 04:12:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XaKRf-0004I2-E4 for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2014 04:12:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaKRf-0004Hw-Ay for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2014 04:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XaKRe-0004d1-Iq for bug-gnu-emacs@gnu.org; Sat, 04 Oct 2014 04:12:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <85wq8ge3gr.fsf@stephe-leake.org> Resent-From: Stephen Leake Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Oct 2014 08:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18626 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18626-submit@debbugs.gnu.org id=B18626.141241030017759 (code B ref 18626); Sat, 04 Oct 2014 08:12:02 +0000 Original-Received: (at 18626) by debbugs.gnu.org; 4 Oct 2014 08:11:40 +0000 Original-Received: from localhost ([127.0.0.1]:60733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaKRH-0004cM-Hh for submit@debbugs.gnu.org; Sat, 04 Oct 2014 04:11:40 -0400 Original-Received: from dnvrco-outbound-snat.email.rr.com ([107.14.73.231]:22380 helo=dnvrco-oedge-vip.email.rr.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaKRE-0004cD-86 for 18626@debbugs.gnu.org; Sat, 04 Oct 2014 04:11:38 -0400 Original-Received: from [70.94.38.149] ([70.94.38.149:49156] helo=TAKVER) by dnvrco-oedge01 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 6B/E6-23176-6BBAF245; Sat, 04 Oct 2014 08:11:34 +0000 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) X-RR-Connecting-IP: 107.14.64.118:25 X-Authority-Analysis: v=2.1 cv=d8V7yHTE c=1 sm=1 tr=0 a=AppmJ/7ZOOFWL/q6u6u93g==:117 a=AppmJ/7ZOOFWL/q6u6u93g==:17 a=ayC55rCoAAAA:8 a=9XSUBuVRJI8A:10 a=o_R75loqY_IA:10 a=9i_RQKNPAAAA:8 a=-4YJsMx7Q-5Xg1-8lWsA:9 X-Cloudmark-Score: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94115 Archived-At: As Eli suggested, I tried changing the pipe buffer size in w32.c pipe2, and the delay in process.c send_process, call to wait_reading_process_output. The pipe buffer size should affect reading from the subprocess, but it doesn't change the timing significantly: (pipe-torture-read "/Projects/emacs/emacs-24.3.94/src/xdisp.c") size time ------------------------ 0 (uses OS default) 11.965184 9192 12.012684 80000 12.018934 The send_process time delay is the cause of the slowdown in write: (find-file "xdisp.c") (pipe-torture "debug.exe" "4096") delay time ------------------------ 20 * 1000 * 1000 4.450068 10 * 1000 * 1000 2.443788 0 * 1000 * 1000 hangs until C-g xdisp.c has 974233 bytes; with a subprocess read buffer of 4096 and a delay of 0.020 seconds, that gives a send time of (* 0.020 (/ 974233 4096)) = 4.74, which is close to what we see above. One way around the write delay is to use a large enough read buffer in the subprocess. In my current real application, this is easy and also gives other benefits. I'm not clear why Emacs hangs with a delay of 0. The subprocess should be running on a separate CPU core, so even if the Emacs process is in a busy wait loop, the subprocess should read input. -- -- Stephe