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: Fri, 10 Oct 2014 03:07:02 -0500 Message-ID: <85lhoouz4p.fsf@stephe-leake.org> References: <85wq8ge3gr.fsf@stephe-leake.org> <85d2a8dzkh.fsf@stephe-leake.org> <83lhowgrr3.fsf@gnu.org> <854mviej2x.fsf@stephe-leake.org> <8338b2oa0j.fsf@gnu.org> <85r3ymcr0u.fsf@stephe-leake.org> <85ppe2vgdk.fsf@stephe-leake.org> <837g0ak6rb.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412928505 15397 80.91.229.3 (10 Oct 2014 08:08:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Oct 2014 08:08:25 +0000 (UTC) Cc: 18626@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 10 10:08:17 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 1XcVFJ-0004ZA-AT for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Oct 2014 10:08:17 +0200 Original-Received: from localhost ([::1]:46725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcVFI-0006cz-Gi for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Oct 2014 04:08:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcVFA-0006cp-E5 for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 04:08:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcVF5-0004hd-1n for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 04:08:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcVF4-0004gw-VX for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 04:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XcVF4-00081H-Ee for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 04:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Leake Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Oct 2014 08:08: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.141292842930758 (code B ref 18626); Fri, 10 Oct 2014 08:08:02 +0000 Original-Received: (at 18626) by debbugs.gnu.org; 10 Oct 2014 08:07:09 +0000 Original-Received: from localhost ([127.0.0.1]:39711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XcVEC-0007zz-H3 for submit@debbugs.gnu.org; Fri, 10 Oct 2014 04:07:08 -0400 Original-Received: from dnvrco-outbound-snat.email.rr.com ([107.14.73.227]:57138 helo=dnvrco-oedge-vip.email.rr.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XcVE9-0007zp-76 for 18626@debbugs.gnu.org; Fri, 10 Oct 2014 04:07:07 -0400 Original-Received: from [70.94.38.149] ([70.94.38.149:51190] helo=TAKVER) by dnvrco-oedge01 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id C6/2F-23176-7A397345; Fri, 10 Oct 2014 08:07:03 +0000 In-Reply-To: <837g0ak6rb.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Oct 2014 16:53:12 +0300") 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=mDV3o1hIAAAA:8 a=eTH9Wmw1qlWkzL1QRvYA:9 a=ii61gXl28gQA:10 a=FMD1XRJ_Ct4A:10 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:94370 Eli Zaretskii writes: >> From: Stephen Leake >> Cc: 18626@debbugs.gnu.org >> Date: Wed, 08 Oct 2014 08:29:59 -0500 >> >> The cause for this is the Sleep in _sys_read_ahead in w32.c. This is >> called from reader_thread after the wait for a single char read >> succeeds. The default wait is 50 ms, set by the elisp variable >> w32-pipe-read-delay. Setting that to 0 gives: >> >> (pipe-torture-read "/Projects/emacs/emacs-24.3.94/src/xdisp.c") >> 0.180000, 0.095000 >> >> only a factor of 2 slower than command-line cat. >> >> w32-pipe-read-delay is a global variable. The comment in _sys_read_ahead >> says there are problems with subprocess interaction when setting this to >> 0 on some systems. If that is still true, we may need to change this to >> a per-subprocess setting. >> >> In my real application, let-binding w32-pipe-read-delay for a short time >> is possible, and a reasonable workaround. > > I think I will set that to -1, on the trunk, except on Windows 9X > systems. That should cause the reader thread yield its time slice > before returning. Can you see how this affects your use case? That has essentially no effect when running on a multi-core machine; the subprocess is scheduled separately. > As for the effect of this on non-Windows 9X systems, I don't see the > problem described in the comment with the "dir" command on Windows XP > when I set this variable's value to zero. And running DOS programs > from a w32 Emacs is much less probable use case these days, what with > the proliferation of 64-bit Windows systems that don't have a DOS > emulator. So I think we can safely make this value zero or -1 on > modern systems. Ok. > Thanks for tracking this down. You're welcome. Thanks for your work on Emacs for Windows! -- -- Stephe