From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Accelerating Emacs? Date: Fri, 28 Oct 2005 15:13:33 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1130511313 24463 80.91.229.2 (28 Oct 2005 14:55:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Oct 2005 14:55:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 28 16:55:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EVVZ6-0000vw-20 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Oct 2005 16:50:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EVVZ5-0003MB-9I for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Oct 2005 10:50:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EVU33-0002V6-NF for help-gnu-emacs@gnu.org; Fri, 28 Oct 2005 09:13:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EVU32-0002T5-AK for help-gnu-emacs@gnu.org; Fri, 28 Oct 2005 09:13:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EVU31-0002Rc-60 for help-gnu-emacs@gnu.org; Fri, 28 Oct 2005 09:13:31 -0400 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EVU30-00057U-SY for help-gnu-emacs@gnu.org; Fri, 28 Oct 2005 09:13:31 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-203-194.inter.net.il [80.230.203.194]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id CVA21990 (AUTH halo1); Fri, 28 Oct 2005 15:13:28 +0200 (IST) Original-To: help-gnu-emacs@gnu.org In-reply-to: (herberteuler@hotmail.com) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30656 Archived-At: > From: "Herbert Euler" > Date: Fri, 28 Oct 2005 19:31:35 +0800 > > >What kind of machine do you have there? I tried this on a 3MB file > >(my email inbox), and it took less than 1 minute, even though I needed > >to answer the question about discarding undo info several times during > >that time. This is on a 3GHz Pentium 4 running Windows XP. I then > >tried the same with a 19MB email box on a 700MHz Pentium III running > >Debian GNU/Linux, and it took 13 minutes there (vim did it in 30 > >seconds). Perhaps you should upgrade your hardware? > > The CPU of this machine is Pentium(R) 4 CPU 2.80 GHz, and there is > 504 MB physical memory, running Windows XP and Emacs 21.3. And on this machine, it took Emacs more than 20 minutes to do the replacement in a 8.8 MB file? That's amazingly slow, and contradicts my testing (although I tested on a real file, not one with random text)! > Task Manager said Emacs were using 229 636K memory Probably because the program that you used to generate the random file conses a lot of strings. Forcing garbage collection could have returned some of the memory to the OS. > I found Emacs used more and more memory when generating random > data, so did when it replacing. These memory is released after Emacs > finishes its job. It is also released during garbage collection. > This happens when I am testing a 100MB size file. I go to the beginning > of the file, press C-SPACE, then go to the end of the file, press M-w. > Emacs told me: > > Warning: past 95% of memory limit Well, M-w causes Emacs to copy the entire 100MB region into the Windows clipboard. To do that, Emacs allocates a temporary buffer copies those 100MB into the buffer, then encodes the text in the temporary buffer as appropriate for the Windows clipboard. As your system has only 512MB of installed physical memory, using up 100MB could easily exhaust what your machine has. If you really need to copy/paste such large regions, you should disable the automatic copying into the clipboard. > So perhaps I can restate it like this: if Emacs starts to be slow in > some condition, it is better of using some other tools instead of > it. That is always true. As Per wrote elsewhere in this thread, Sed is ideally suited for the substitutions that you tried, especially on very large files.