From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: request for review: Doing direct file I/O in Emacs Lisp Date: Fri, 14 May 2004 14:43:59 -0700 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87isf0vjtl.fsf@emptyhost.emptydomain.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084574868 3126 80.91.224.253 (14 May 2004 22:47:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 May 2004 22:47:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat May 15 00:47:40 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOlSu-0002io-00 for ; Sat, 15 May 2004 00:47:40 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOlSu-0001lC-00 for ; Sat, 15 May 2004 00:47:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOlHE-0003XF-Ug for emacs-devel@quimby.gnus.org; Fri, 14 May 2004 18:35:36 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BOlFw-0003EL-7T for emacs-devel@gnu.org; Fri, 14 May 2004 18:34:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BOkTM-0001U9-4G for emacs-devel@gnu.org; Fri, 14 May 2004 17:44:35 -0400 Original-Received: from [66.111.4.26] (helo=out2.smtp.messagingengine.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOkTL-0001Tk-AO for emacs-devel@gnu.org; Fri, 14 May 2004 17:44:03 -0400 X-Sasl-enc: Rg481ncrEyjyKMWt5ZiHUQ 1084571041 Original-Received: from Majnun.newartisans.com (65-101-11-205.phnx.qwest.net [65.101.11.205]) by mail.messagingengine.com (Postfix) with ESMTP id 0C4B9B7D04D for ; Fri, 14 May 2004 17:44:00 -0400 (EDT) Original-Received: by Majnun.newartisans.com (Postfix, from userid 501) id 5BA902E6DF5; Fri, 14 May 2004 14:43:59 -0700 (PDT) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23442 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23442 Richard Stallman writes: > When eshell sees a redirect from a builtin, I think it would be most > efficient to produce the output in a buffer and write it with > write-region into the file. Below are the results of comparing write-region to the file-handle API. This test used Eshell's builtin cat to write 21MB to another file. ~74s save-buffer (the current method) ~82s file-handle-write ~250s write-region [with call to `message' disabled] ~318s write-region It is interesting that write-region is by far the most inefficient, and that my file-handle API is not the fastest method. I therefore retract my earlier proposal. However, the real slowdown is with start-process, as others mentioned. Here are the times for doing the same cat, but using the system's cat: ~952s file-handle-write ...s save-buffer (the current method) In this case, save-buffer took so long that after 20 minutes Emacs hung (for some other reason), and I didn't have sufficient patience to run the test again. > When it is a matter of a subprocess, what could be useful is a > feature for start-process to specify files for additional > descriptors. That would be a completely different feature. This would be very useful. John