From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: request for review: Doing direct file I/O in Emacs Lisp Date: Sat, 15 May 2004 14:33:53 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87isf0vjtl.fsf@emptyhost.emptydomain.de> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1084646232 13961 80.91.224.253 (15 May 2004 18:37:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 May 2004 18:37:12 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat May 15 20:37:07 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 1BP41z-0007Yq-00 for ; Sat, 15 May 2004 20:37:07 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BP41z-0000es-00 for ; Sat, 15 May 2004 20:37:07 +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 1BP41k-0004ir-3p for emacs-devel@quimby.gnus.org; Sat, 15 May 2004 14:36:52 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BP3zc-00049L-QE for emacs-devel@gnu.org; Sat, 15 May 2004 14:34:41 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BP3ys-0003XD-QZ for emacs-devel@gnu.org; Sat, 15 May 2004 14:34:27 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BP3ys-0003Wa-Av for emacs-devel@gnu.org; Sat, 15 May 2004 14:33:54 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1BP3yr-0007q7-ME; Sat, 15 May 2004 14:33:53 -0400 Original-To: John Wiegley In-reply-to: (message from John Wiegley on Fri, 14 May 2004 14:43:59 -0700) 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:23499 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23499 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. Since save-buffer calls write-region, both the fastest and the slowest method use write-region. What is the difference between these two methods? I wonder if it has to do with whether a coding system is being used, or whether a coding system is being detected automatically. 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: Sorry, I do not understand what that means. ~952s file-handle-write ...s save-buffer (the current method) I can't understand what alternatives you have compared. Could you please explain them more concretely? start-process takes a certain amount of time, but it should be a fixed amount, and less than a second. How many times did you start a process here?