From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Re: How to circumvent warning in batch mode Date: Sat, 10 Oct 2009 01:23:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <915aab95-ae73-442a-9bbc-e177c431af7b@e8g2000yqo.googlegroups.com> References: <5ebdc222-a8b5-4eed-9481-39b813da5f1c@j28g2000vbl.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1255164130 7910 80.91.229.12 (10 Oct 2009 08:42:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Oct 2009 08:42:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 10 10:42:03 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MwXWc-00031R-Jo for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Oct 2009 10:42:02 +0200 Original-Received: from localhost ([127.0.0.1]:47658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwXWc-0008FI-3U for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Oct 2009 04:42:02 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!e8g2000yqo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1255163020 16771 127.0.0.1 (10 Oct 2009 08:23:40 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 10 Oct 2009 08:23:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e8g2000yqo.googlegroups.com; posting-host=84.53.123.169; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:173713 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:68806 Archived-At: On Oct 9, 4:42=A0pm, Andreas Politz wrote: > I would suggest removing the body of the while-loop, in order to see if > there is actually a significant amount of time spend there. There the most time is spend. Without inner-loop it took 5 seconds. Whithout the search for the regexp 3,5 seconds. And without the write half a second. The complete scripts takes 17,5 seconds. When the inner loop only has the setq for match-length it takes 5,5 seconds. When I also have the loop to increase substitute-str it takes 6,5 seconds. The complete scripts takes 17,5 seconds. When I change the code to: (while (re-search-forward reg-exp nil t) (replace-match substitute-str) ) Then it takes 15 seconds. So it looks like replace-match is very expensive. A candidate for optimalisation? > Depending on the file, a great deal goes probably into the > initialization of the major-mode. =A0Maybe you can use > `find-file-literally' or some other means, I don't know. I allready changed to: (switch-to-buffer (find-file-noselect input-file t t))