Subject: Re: bug#1024: Large C++ files load slowly, regardless of font-lock-maximum-size

From: Alan Mackenzie <[email-masked]>
Date: Fri, 26 Sep 2008 07:53:19 +0000

Hi, John,

On Thu, Sep 25, 2008 at 08:22:34PM -0700, John W wrote:
> > Could you please have a look at the description of bug#851

> > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=851

> > and try the recipe proposed there by Chong Yidong?

> Sure.  I tried this patch

> +++ cc-engine.el	2008/04/01 21:41:21	1.56.2.11

This slowdown happened because of an earlier bug fix.  Part of that fix
is scanning the entire buffer, "fixing" things which could derail the
syntax and font locking, e.g. preprocessor lines like this:

#warning this isn't fixed yet!
                 ^
, where the apostrophe was being treated like a string opener.

That fix was not coded with a view to speed, unfortunately.  It was later
fixed in cc-mode.el version 1.75 (CVS trunk at savannah) and version
1.58.2.12 (in the Emacs 22 branch) on 2008-05-24.

The fix was incorporated into Emacs 22.3, released a few days ago.

Also, thanks for generating and posting the stack dump, which made it
trivially easy to track down the problem.

> - John

-- 
Alan Mackenzie (Nuremberg, Germany).