[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14886: Fwd: A significant slowdown calling font-lock-fontify-buffer

From: Paul Eggert
Subject: bug#14886: Fwd: A significant slowdown calling font-lock-fontify-buffer from a hook
Date: Wed, 17 Jul 2013 05:50:57 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

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?

Attachment: emacs-24.3.gprof.xz
Description: application/xz

Attachment: emacs-113441.gprof.xz
Description: application/xz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]