From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Emacs 23.0 is much slower starting than Emacs 22.3 Date: Fri, 24 Oct 2008 11:21:04 +0000 Message-ID: <20081024112104.GA3246@muc.de> References: <48FF58FB.6000302@harpegolden.net> <20081022211202.GA1037@muc.de> <49001F5A.7040402@harpegolden.net> <20081023090908.GB2666@muc.de> <4900ACF9.7060501@harpegolden.net> <4900FF17.2000203@harpegolden.net> <49011336.10307@harpegolden.net> <4901287F.3000203@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224846701 17868 80.91.229.12 (24 Oct 2008 11:11:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2008 11:11:41 +0000 (UTC) Cc: Eli Zaretskii , Lennart Borgman , monnier@iro.umontreal.ca, emacs-devel@gnu.org To: David De La Harpe Golden Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 24 13:12:41 2008 connect(): Connection refused 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 1KtKaq-0002BZ-5e for ged-emacs-devel@m.gmane.org; Fri, 24 Oct 2008 13:12:36 +0200 Original-Received: from localhost ([127.0.0.1]:36837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtKZk-00043y-9x for ged-emacs-devel@m.gmane.org; Fri, 24 Oct 2008 07:11:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KtKZg-00043a-Ls for emacs-devel@gnu.org; Fri, 24 Oct 2008 07:11:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KtKZe-000434-6w for emacs-devel@gnu.org; Fri, 24 Oct 2008 07:11:24 -0400 Original-Received: from [199.232.76.173] (port=49631 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtKZd-00042n-W5 for emacs-devel@gnu.org; Fri, 24 Oct 2008 07:11:22 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:2736 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KtKZc-0000jS-GQ for emacs-devel@gnu.org; Fri, 24 Oct 2008 07:11:21 -0400 Original-Received: (qmail 23597 invoked by uid 3782); 24 Oct 2008 11:11:18 -0000 Original-Received: from acm.muc.de (pD9E23A1C.dip.t-dialin.net [217.226.58.28]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 24 Oct 2008 13:11:16 +0200 Original-Received: (qmail 4759 invoked by uid 1000); 24 Oct 2008 11:21:04 -0000 Content-Disposition: inline In-Reply-To: <4901287F.3000203@harpegolden.net> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:104942 Archived-At: Hi, David! First of all, I'm writing this on Friday, ~10:45 UCT. My ISP's mail server is having problems, so I don't know when this will get through. It's somewhat frustrating. :-( On Fri, Oct 24, 2008 at 02:44:31AM +0100, David De La Harpe Golden wrote: > David De La Harpe Golden wrote: > >+++ Which leaves set-auto-mode... > Which seems to be mostly the particular mode - So of course, this can > presumably vary wildly from mode to mode, but let's take c-mode (seeing > as it's for the c files I was testing with): > set-auto-mode->set-auto-mode-0-> > c-mode-> (c-init-language-vars-for, > c-common-init->(c-basic-common-init, > run some internal hooks, like the "neutralize"), ...) > See existing c-neutralize-syntax-in-CPP initial comment: > "SPEED _MATTERS_ IN THIS FUNCTION!!!" > Profiling confirms - yes, it does. :-) That function's one of mine. :-) The story behind the comment is that my original version of that function was written without consideration of its speed, and was about two orders of magnitude slower. People were complaining, with justification, that it was taking ~1 minute to load a large file.c. However, the current function isn't that slow. I timed it for 100 iterations on a file 2,927,889 bytes big. It's taking 0.72s for this file, i.e. about 0.25s per megabyte, and that's on my 1.2 GHz Athlon. So on emacs/src's 118 files.c, total size 8772802, that function would take only 2.5s, again, on my Athlon. On your machine it would be ~0.5s. Besides, in my original measurements, I was executing the same CC Mode in Emacs 22 and Emacs 23. c-neutralize-syntax-in-CPP isn't the problem. [ .... ] -- Alan Mackenzie (Nuremberg, Germany).