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: Slow fontification in C mode buffers Date: Wed, 21 Dec 2011 16:04:06 +0000 Message-ID: <20111221160406.GA2629@acm.acm> References: <20111203151824.GA4566@acm.acm> <87pqfso5d3.fsf@isil.kanru.info> <20111215134332.GA5698@acm.acm> <87y5udizdy.fsf@isil.kanru.info> <20111215181215.GA3464@acm.acm> <87ty51i6vf.fsf@isil.kanru.info> <20111216112617.GA3445@acm.acm> <87pqfngp3r.fsf@isil.kanru.info> <20111221105626.GA3263@acm.acm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1324483838 18054 80.91.229.12 (21 Dec 2011 16:10:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Dec 2011 16:10:38 +0000 (UTC) Cc: Kan-Ru Chen , emacs-devel@gnu.org To: Geoff Gole Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 21 17:10:34 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RdOkS-0000p6-GT for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2011 17:10:32 +0100 Original-Received: from localhost ([::1]:37001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdOkS-00046v-0F for ged-emacs-devel@m.gmane.org; Wed, 21 Dec 2011 11:10:32 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdOkJ-00046k-Vl for emacs-devel@gnu.org; Wed, 21 Dec 2011 11:10:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdOkE-0003bv-76 for emacs-devel@gnu.org; Wed, 21 Dec 2011 11:10:23 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:38966 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdOkD-0003bp-Tc for emacs-devel@gnu.org; Wed, 21 Dec 2011 11:10:18 -0500 Original-Received: (qmail 41466 invoked by uid 3782); 21 Dec 2011 16:10:15 -0000 Original-Received: from acm.muc.de (pD95567D9.dip.t-dialin.net [217.85.103.217]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 21 Dec 2011 17:10:14 +0100 Original-Received: (qmail 2841 invoked by uid 1000); 21 Dec 2011 16:04:06 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146901 Archived-At: Hi, Geoff On Wed, Dec 21, 2011 at 09:33:09PM +0800, Geoff Gole wrote: > If another data point will help, I've also noticed *very* slow c-mode > fontification in a script generated header, > /usr/include/GL/gl_mangle.h. In case you don't have this header, a > copy is attached. > The file is basically several thousand #defines. Thanks for the report. The problem here is that CC Mode normally steps back and forth through a source code using brace positions as "ladder rungs". A sequence of #defines is, sadly, a "brace desert". If you're running GNU Emacs, an optimisation was introduced in Emacs 23.3 which gave a considerable speed-up to such code. This optimisation found its way into the XEmacs CC Mode package in September. I _hope_ your version of Emacs is prior to one of these, in which case upgrading will give you this benefit. Otherwise, I'll be asking you if you're prepared to give me some timings. Here's hoping..... -- Alan Mackenzie (Nuremberg, Germany).