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: Sat, 15 May 2004 14:36:38 -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 1084657307 18296 80.91.224.253 (15 May 2004 21:41:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 May 2004 21:41:47 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat May 15 23:41:39 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 1BP6uZ-00053O-00 for ; Sat, 15 May 2004 23:41:39 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BP6uY-0005D4-00 for ; Sat, 15 May 2004 23:41:38 +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 1BP6sW-0005Xb-CQ for emacs-devel@quimby.gnus.org; Sat, 15 May 2004 17:39:32 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BP6rt-0005R4-2q for emacs-devel@gnu.org; Sat, 15 May 2004 17:38:53 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BP6rM-0005JF-LM for emacs-devel@gnu.org; Sat, 15 May 2004 17:38:51 -0400 Original-Received: from [66.111.4.26] (helo=out2.smtp.messagingengine.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BP6rM-0005JC-CF for emacs-devel@gnu.org; Sat, 15 May 2004 17:38:20 -0400 X-Sasl-enc: tiWUohbxAeQGsCMCmnPkVw 1084657002 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 9390FB8573C for ; Sat, 15 May 2004 17:36:42 -0400 (EDT) Original-Received: by Majnun.newartisans.com (Postfix, from userid 501) id 69A572E8085; Sat, 15 May 2004 14:36:39 -0700 (PDT) Original-To: emacs-devel@gnu.org In-Reply-To: (Richard Stallman's message of "Sat, 15 May 2004 14:33:53 -0400") 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:23510 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23510 Richard Stallman writes: > Since save-buffer calls write-region, both the fastest and the > slowest method use write-region. What is the difference between > these two methods? Hmm.. that IS curious. In the save-buffer case, I call insert-and-inherit in a temp buffer thousands of times, then one call to save-buffer. In the write-region case, I am calling write-region thousands of times. I think the difference is the constant filesystem access in the latter case. > 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? If I start a process with start-process (/usr/bin/cat) and redirect its output to a file, it is far slower than if I simply output the same data to a file (eshell/cat) -- even though the resulting "output" in both cases is the same. Why is receiving output via a process sentinel so slow? > 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? I am only starting the system cat once. John