emacs-devel
[Top][All Lists]
Advanced

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

Re: A significant slowdown calling font-lock-fontify-buffer from a hook


From: Eli Zaretskii
Subject: Re: A significant slowdown calling font-lock-fontify-buffer from a hook
Date: Tue, 16 Jul 2013 21:01:20 +0300

> From: Juanma Barranquero <address@hidden>
> Date: Tue, 16 Jul 2013 02:12:40 +0200
> 
> I discovered this because I call colum-marker-1 (from
> colum-marker-mode, http://www.emacswiki.org/emacs/column-marker.el) in
> the prog-mode-hook, but the issue is with font-lock-fontify-buffer.
> 
> emacs -Q --eval "(add-hook 'prog-mode-hook
> #'font-lock-fontify-buffer)" src/xdisp.c -f kill-emacs
> 
> On Emacs 24.3, -O0 -g3 --enable-checking: about 2 seconds.
> On trunk, -O2 -g3 --enable-checking: ~ 33 seconds, x16 slowdown.
> 
> Any idea what could be causing this?

Is the "calling from a hook" an important part of this issue?  If so,
why?

I tried this:

  emacs -Q
  M-x global-font-lock-mode RET
  C-x C-f src/xdisp.c RET
  M-: (font-lock-fontify-buffer) RET

Is this a valid way of reproducing the slowdown?  If so, modify the
last command to start the profiler before invoking
font-lock-fontify-buffer and stop it after it returns, and you will
see that the current trunk calls a certain bunch of functions at least
five-fold more times than Emacs 24.3.  Could that be the reason?



reply via email to

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