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: Sun, 05 Oct 2014 08:41:08 -0500 Message-ID: <85zjdad47f.fsf@stephe-leake.org> References: <85wq8ge3gr.fsf@stephe-leake.org> <83oatsgswd.fsf@gnu.org> <858ukuejps.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412516545 13703 80.91.229.3 (5 Oct 2014 13:42:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Oct 2014 13:42: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 Sun Oct 05 15:42:16 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 1Xam4k-0003Qt-TV for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Oct 2014 15:42:15 +0200 Original-Received: from localhost ([::1]:47526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xam4k-0001BZ-HC for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Oct 2014 09:42:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xam4d-0001BQ-I6 for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 09:42:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xam4Y-0005vy-7I for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 09:42:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xam4Y-0005vE-3y for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 09:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xam4X-0004Jz-IT for bug-gnu-emacs@gnu.org; Sun, 05 Oct 2014 09:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Leake Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Oct 2014 13:42:01 +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.141251647416557 (code B ref 18626); Sun, 05 Oct 2014 13:42:01 +0000 Original-Received: (at 18626) by debbugs.gnu.org; 5 Oct 2014 13:41:14 +0000 Original-Received: from localhost ([127.0.0.1]:33576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xam3l-0004Iy-AD for submit@debbugs.gnu.org; Sun, 05 Oct 2014 09:41:13 -0400 Original-Received: from dnvrco-outbound-snat.email.rr.com ([107.14.73.225]:14688 helo=dnvrco-oedge-vip.email.rr.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xam3i-0004Ip-Bz for 18626@debbugs.gnu.org; Sun, 05 Oct 2014 09:41:11 -0400 Original-Received: from [70.94.38.149] ([70.94.38.149:49542] helo=TAKVER) by dnvrco-oedge02 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 9E/E7-08316-57A41345; Sun, 05 Oct 2014 13:41:09 +0000 In-Reply-To: <858ukuejps.fsf@stephe-leake.org> (Stephen Leake's message of "Sun, 05 Oct 2014 08:20:47 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) X-RR-Connecting-IP: 107.14.64.130:25 X-Authority-Analysis: v=2.1 cv=ReIeCjdv 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=uK4GQZ33S1GECPavXOwA:9 a=FMD1XRJ_Ct4A:10 a=ii61gXl28gQA: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:94162 Archived-At: Stephen Leake writes: > Eli Zaretskii writes: > >> Can you present similar timings from some Posix platform for >> comparison? > > On Debian wheezy, with emacs 24.3.94: > > $ cd /tmp > $ time cat < /home/Projects/emacs/emacs-24.3.94/src/xdisp.c > xdisp.c > real 0m0.007s > user 0m0.000s > sys 0m0.004s > > > (find-file "emacs-24.3.94/src/xdisp.c") > (pipe-torture "cat.exe") > 1.556597 > > much faster than Windows, but still slow relative to plain file IO. > > (pipe-torture "debug.exe" "4096") > > This dies, because "debug.exe" exits early. It turns out that Emacs is > sending one line of the buffer at a time. I have not yet tried to figure > out why that doesn't happen on Windows. I rewrote debug.adb to handle this case by exiting when the total bytes read equals the file size: with Ada.Command_Line; with Ada.Text_IO; use Ada.Text_IO; with GNAT.OS_Lib; procedure Debug_Counted is use GNAT.OS_Lib; Chunk : constant Integer := Integer'Value (Ada.Command_Line.Argument (1)); File_Size : constant Integer := Integer'Value (Ada.Command_Line.Argument (2)); File : constant File_Descriptor := GNAT.OS_Lib.Standin; Read_Bytes : Integer; Total_Read_Bytes : Integer := 0; Text : aliased String (1 .. Chunk); Short_Count : Integer := 0; Count : Integer := 0; begin loop Read_Bytes := Read (File, Text'Address, Chunk); Total_Read_Bytes := Total_Read_Bytes + Read_Bytes; if Read_Bytes < Chunk then Short_Count := Short_Count + 1; else Count := Count + 1; end if; exit when Total_Read_Bytes >= File_Size; end loop; Put_Line ("Short_Count => " & Integer'Image (Short_Count) & " Count => " & Integer'Image (Count)); end Debug_Counted; (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. -- -- Stephe