Re: font-latex extremely slow

Ralf Angeli <[email protected]> Wed, 23 Mar 2005 10:16:10 +0100
Newsgroups gmane.emacs.auc-tex
Organization nil
Message-ID <[email protected]>
* Reiner Steib (2005-03-22) writes:

> Not much later
> (font_latex_Emacs-CVS_22.elp in [1]; 21:16), it became extremely slow.
> After inserting a SPC, I had to wait around 15 seconds until it is
> displayed. :-/

Hm, did it get better after you typed SPC or something else?  I am
asking because jit-lock stealthily fontifies parts of the file not
seen in the current window when Emacs is left idle for
`jit-lock-stealth-time' seconds.  But as soon as one carries out some
action, it should stop with this again.  Of course it can also be
fontification of the currently visible area which is taking a lot of
processing time.

> Here are only the first few lines, see [1] for the details.
>
> font_latex_Emacs-CVS_21.elp:
>
> --8<---------------cut here---------------start------------->8---
> Function Name                             Call Count  Elapsed Time  Average Time
> ========================================  ==========  ============  ============
> font-lock-fontify-region                  538         16.933772000  0.0314754126
> font-lock-default-fontify-region          538         16.887768999  0.0313899052
> font-lock-fontify-keywords-region         538         14.968205000  0.0278219423
> re-search-forward                         138543      4.2191800000  3.045...e-05
[...]
> font_latex_Emacs-CVS_22.elp:
>
> --8<---------------cut here---------------start------------->8---
> Function Name                             Call Count  Elapsed Time  Average Time
> ========================================  ==========  ============  ============
> font-lock-fontify-region                  404         265.28239     0.6566395792
> font-lock-default-fontify-region          404         265.27944099  0.6566322797
> font-lock-fontify-keywords-region         404         243.64648800  0.6030853663
> font-latex-match-command-with-arguments   443965      59.318243999  0.0001336101
> re-search-forward                         2015961     56.760200000  2.815...e-05

Again, this is the pure amount of matched keywords which kicks in.

What you could try to do in order to better debug the problem is
disabling `global-font-lock-mode' and calling
`font-lock-fontify-keywords-region' manually.

-- 
Ralf