GNU bug report logs - #14886
Slowdown on font-lock-fontify-buffer

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Tue, 16 Jul 2013 23:05:02 UTC

Severity: normal

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 14886 <at> debbugs.gnu.org
Subject: bug#14886: Fwd: A significant slowdown calling font-lock-fontify-buffer from a hook
Date: Wed, 17 Jul 2013 05:50:57 -0700
[Message part 1 (text/plain, inline)]
On 07/17/2013 04:42 AM, Juanma Barranquero wrote:
> Could all this be related to Paul's substitution
> of many macros by inline functions?

Could be.  Did the problem start happening with
trunk bzr 113359?  If so, I would suspect that
it's the recent changes to syntax.c.

But I'm afraid I don't understand what the problem is.
I tried the test case in the bug report:

  src/emacs -Q --eval "(add-hook 'prog-mode-hook #'font-lock-fontify-buffer)" src/xdisp.c -f kill-emacs

I'm running Fedora 17 x86-64 with GCC 4.8.1.
On Emacs 24.3 (configured with --enable-profiling,
but compiled with the default -O2 optimization) this
takes 1.1 s (user + system CPU time).  In the current
trunk (bzr 113441) it takes 50.1 s.

The difference is so large that there must be something
else going on.  Looking at the gprof outputs (attached)
it appears that 24.3 is invoking scan_sexps_forward
only 1628 times, whereas the current trunk is invoking
it 400829 times.  So I assume that most of the performance
difference is something at the Lisp level.  Or perhaps I'm
just not running the correct test case?
[emacs-24.3.gprof.xz (application/x-xz, attachment)]
[emacs-113441.gprof.xz (application/x-xz, attachment)]

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

Previous Next


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