Re: font-latex extremely slow

Reiner Steib <[email protected]> Tue, 22 Mar 2005 21:44:09 +0100
Newsgroups gmane.emacs.auc-tex
Organization Dept. of Theoretical Physics, University of Ulm
Message-ID <[email protected]>
On Tue, Mar 22 2005, Ralf Angeli wrote:

> Maybe profiling some font-lock-* functions helps to identify the
> problem.

I have added profiling of font-lock.  I still couldn't trigger it with
Emacs 21 (see font_latex_21-3_okay_NN.elp in [1]; NN=13,14 including
font-lock profiling).  Switching to Emacs CVS, a noticeable slow down
appeared after some minutes of editing (font_latex_Emacs-CVS_21.elp in
[1]; after approx. 5 minutes: 21:05-21:10).  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. :-/

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-match-command-with-arguments   36534       3.9586750000  0.0001083559
font-latex-match-reference                13455       1.9381599999  0.0001440475
font-lock-append-text-property            140540      1.9180019999  1.364...e-05
font-latex-match-function                 14334       1.6565669999  0.0001155690
font-lock-fontify-syntactically-region    521         1.6261800000  0.0031212667
font-latex-commented-outp                 27982       0.6558939999  2.343...e-05
--8<---------------cut here---------------end--------------->8---

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
font-latex-match-function                 222502      32.803950000  0.0001474321
font-lock-append-text-property            2214326     32.698966999  1.476...e-05
font-latex-match-reference                179086      25.588266999  0.0001428825
font-lock-fontify-syntactically-region    404         17.151850000  0.0424550742
font-latex-find-matching-close            390242      12.066891999  3.092...e-05
font-latex-commented-outp                 419038      8.3206519999  1.985...e-05
--8<---------------cut here---------------end--------------->8---


>> I will test some revisions of `font-latex.el'.  Maybe I can identify a
>> specific change.

(I didn't do this upto now.)

Bye, Reiner.

[1] http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/auctex/elp/
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/