[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:47:11 +0300 |
> From: Juanma Barranquero <address@hidden>
> Date: Tue, 16 Jul 2013 20:26:56 +0200
> Cc: Emacs developers <address@hidden>
>
> > Is the "calling from a hook" an important part of this issue?
>
> Doing
>
> emacs -Q src/xdisp.c
> M-x font-lock-fontify-buffer <RET>
>
> I don't see the slowdown.
First, you need to turn off global-font-lock-mode before visiting
xdisp.c. Second, if you do turn off global-font-lock-mode, invoking
font-lock-fontify-buffer will fail in Emacs 24.3. You need to do
something like this instead:
M-: (let ((c-standard-font-lock-fontify-region-function
'font-lock-default-fontify-region)) (font-lock-fontify-buffer)) RET
If I do this in Emacs 24.3 and in the current trunk, I do see a
significant slowdown: it takes 18 sec with 24.3, and 72 sec with the
current trunk.
So I think the invocation from hook is not a factor here, which is a
Good Thing, because debugging this will be much simpler ;-)