From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 22.1.50; insert-file-contents is slow under tramp Date: Mon, 27 Aug 2007 00:16:40 -0400 Message-ID: References: <87veb6l9b0.fsf@escher.local.home> <46CD98DC.1050701@gmx.at> <87r6lul2fc.fsf@escher.local.home> <46CDC8B3.7000301@gmx.at> <46CDED2B.3080904@gmx.at> <87k5rmkmu0.fsf@escher.local.home> <46CDF5B7.2030201@gmx.at> <87fy2akjzt.fsf@escher.local.home> <87bqcxzeat.fsf@gmx.de> <871wdqlgzz.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1188188513 20252 80.91.229.12 (27 Aug 2007 04:21:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Aug 2007 04:21:53 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, Stephen Berman , emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 27 06:21:48 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IPW6k-0002mv-6i for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2007 06:21:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IPW6j-00053m-Jh for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2007 00:21:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IPW6g-00053f-Jd for emacs-devel@gnu.org; Mon, 27 Aug 2007 00:21:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IPW6g-00053K-8S for emacs-devel@gnu.org; Mon, 27 Aug 2007 00:21:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IPW6f-00053H-Vu for emacs-devel@gnu.org; Mon, 27 Aug 2007 00:21:42 -0400 Original-Received: from tomts40.bellnexxia.net ([209.226.175.97] helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IPW6b-00023c-MU; Mon, 27 Aug 2007 00:21:37 -0400 Original-Received: from pastel.home ([70.55.146.55]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070827041640.NVGX29719.tomts40-srv.bellnexxia.net@pastel.home>; Mon, 27 Aug 2007 00:16:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 562FF7F7A; Mon, 27 Aug 2007 00:16:40 -0400 (EDT) In-Reply-To: <871wdqlgzz.fsf@gmx.de> (Michael Albinus's message of "Sun\, 26 Aug 2007 12\:36\:32 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:77255 gmane.emacs.pretest.bugs:19636 Archived-At: >>> Yes. I've installed a patch in the trunk, which makes a fast track for >>> "remote" files being on localhost. >> >> How does that work? I mean when accessing files on the localhost with >> Tramp, the most likely situation I can think of is the `su' method so how >> what does your "fast track" do to transfer the file faster? Does it copy it >> to /tmp at the "remote" end, then make it world-readable, then copy it on >> the "local" end, then remove it at the remote end? > Similar approach. It calls `tramp-do-copy-or-rename-file-directly', > which copies the "remote" file to /tmp, and assigns proper > permissions. What would be proper permissions? I mean: how do you make sure that some nasty third party won't be able to read the content of that temp file, while still making it possible for Emacs to access the file? > I haven't investigated too much. mimencode and base64-decode are pretty > fast, even on my stone-age machine, with an 8MB sized file: > | (with-current-buffer (get-buffer-create "foo") > | (elp-instrument-function 'call-process) > | (elp-instrument-function 'base64-decode-region) > | (erase-buffer) > | > | (call-process "mimencode" nil t nil "/var/cache/apt/pkgcache.bin") > | (base64-decode-region (point-min) (point-max)) > | (elp-results)) > | > | Function Name Call Count Elapsed Time Average Time > | ==================== ========== ============ ============ > | base64-decode-region 1 7.732203 7.732203 > | call-process 1 1.917887 1.917887 > But with the installed "fast track", it is remarkable faster than even > these two basic functions: 1MB/s for base64 sounds terribly slow. My 266MHz home-router can send and encrypt data from disk to the network at about that speed. But admittedly, we're not talking `mimencode' but base64-decode-region which may include a lot of overhead to extract and insert data from/to the buffer. Stefan