GNU bug report logs - #42490
Emacs is very slow when navigating into a specific C++ file

Previous Next

Package: emacs;

Reported by: Olivier Scalbert <olivier.scalbert <at> algosyn.com>

Date: Thu, 23 Jul 2020 11:00:02 UTC

Severity: normal

Fixed in version 27.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mattias EngdegÄrd <mattiase <at> acm.org>
To: Olivier Scalbert <olivier.scalbert <at> algosyn.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 42490 <at> debbugs.gnu.org
Subject: bug#42490: Emacs is very slow when navigating into a specific C++ file 
Date: Fri, 24 Jul 2020 18:46:45 +0200
Hello Olivier,

Thanks for the report! Could you try Emacs 27 (or git master), building from source if necessary? Those versions should be slightly faster, although the response time is probably well below acceptable.

If we distill the essentials of your file to some sort of benchmark, we might end up with:

(with-temp-buffer
  (c++-mode)
  (dotimes (_ 1000)
    (insert "OP(ed,b0) { ldir(); } /* LDIR */\n"))
  (garbage-collect)
  (let ((t0 (current-time)))
    (font-lock-ensure (point-min) (point-max))
    (time-to-seconds (time-since t0))))

Emacs 26.3 runs it in 11.9 s on this old lappy, but Emacs 27 does it in 3.3 s. This is a clear improvement but we should be able to do better. Alan may have a feeling for where the cycles are spent.





This bug report was last modified 4 years and 295 days ago.

Previous Next


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