GNU bug report logs - #40052
CC Mode 5.34 (C++//l); cc-mode hangs fontifying src/hotspot/share/runtime/globals.hpp in OpenJDK

Previous Next

Package: cc-mode;

Reported by: Nick Gasson <nick.gasson <at> arm.com>

Date: Fri, 13 Mar 2020 14:33:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #22 received at 40052-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Nick Gasson <nick.gasson <at> arm.com>
Cc: 40052-done <at> debbugs.gnu.org
Subject: Re: bug#40052: CC Mode 5.34 (C++//l); cc-mode hangs fontifying
 src/hotspot/share/runtime/globals.hpp in OpenJDK
Date: Fri, 15 May 2020 19:44:50 +0000
Hello, Nick.

On Wed, Apr 22, 2020 at 12:11:18 +0800, Nick Gasson wrote:

> > OK, thanks.  I've had another look into CC Mode, and found a bug in the
> > handling of its macro cache.  It isn't saving the position of the end of
> > the macro, hence is doing too much scanning.

> > I've fixed this in the following patch, which gives another factor of ~5
> > speedup in the scrolling.  Please remove the previous patch before
> > applying this new one.

> > However, the scrolling still gets sluggish towards the end of
> > globals.hpp.  This is because CC Mode's function which goes back to the
> > beginning of a statement is scanning back over the entire macro.  It
> > basically looks for semicolons or closing braces (at top level) and
> > there are none in the huge macro.  I tried creating a variant of
> > globals.hpp, where each "function call" was terminated by a semicolon.
> > The sluggishness was entirely fixed.  This is largely theoretical, as I
> > assume you have no control over the contents of globals.hpp.

> > Anyhow, here is the patch.  Please let me know if there are still
> > problems with it.  Thanks!


> Hi Alan,

> I tried the second patch and it's working well. Thanks again.

Thanks for the testing.  I've finally got around to committing it into
Emacs, but sadly the cut-off for Emacs 27 has long past, so the fix
won't be seeing the light of day until Emacs 28 (or the next stand-alone
CC Mode, of course).

> There was some discussion of getting rid of the giant macro on the
> OpenJDK mailing list. That's when I realised several other people had
> the same problem opening that file in Emacs.

> https://mail.openjdk.java.net/pipermail/hotspot-dev/2020-March/041088.html

Well, without that macro, a bug might have remained unfixed for a
long(er) time, but if it were up to me, I'd want to reduce the size of
that macro, too.  ;-)

> Nick

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 5 years and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.