font-latex extremely slow

Reiner Steib <[email protected]> Mon, 21 Mar 2005 20:05:58 +0100
Newsgroups gmane.emacs.auc-tex
Organization Dept. of Theoretical Physics, University of Ulm
Message-ID <[email protected]>
--=-=-=

Hi,

I'm editing a 250k LaTeX document.  Once in a while, `font-latex' is
getting extremely slow.  My impression is that it might be triggered
by jumping around in the file and doing some edition at various
places.

Below is some (bad) result from ELP.  Note that this results are on an
AMD Athlon 3500+ which should really be fast enough for font-lock.


--=-=-=
Content-Disposition: attachment; filename=font_latex_07.elp

Function Name                              Call Count  Elapsed Time  Average Time
=========================================  ==========  ============  ============
font-latex-match-command-with-arguments    831547      120.50635400  0.0001449182
re-search-forward                          3719043     104.25957399  2.803...e-05
font-latex-match-function                  393912      65.757490000  0.0001669344
font-latex-match-reference                 319182      54.945771000  0.0001721455
font-latex-find-matching-close             686736      20.606912000  3.000...e-05
font-latex-commented-outp                  737399      14.522041000  1.969...e-05
font-latex-match-textual                   41717       7.7661990000  0.0001861638
font-latex-match-math-envII                78670       7.4053029999  9.413...e-05
font-latex-match-command-in-braces         27065       5.6896190000  0.0002102205
font-latex-match-warning                   122265      5.5870549999  4.569...e-05
font-latex-faces-present-p                 784196      4.5554130000  5.809...e-06
font-latex-unfontify-region                4968        4.4938819999  0.0009045656
font-latex-match-type-declaration          17084       4.4182010000  0.0002586163
font-latex-match-title-3                   17233       2.4340839999  0.0001412455
font-latex-match-title-1                   8778        2.1281460000  0.0002424408
font-latex-syntactic-face-function         572997      2.1248489999  3.708...e-06
font-latex-match-title-2                   12346       2.1045629999  0.0001704651
font-latex-match-title-4                   12215       1.8298379999  0.0001498025
font-latex-match-variable                  5066        1.4754679999  0.0002912491
font-latex-match-bold-declaration          5010        1.2158150000  0.0002426776
font-latex-match-italic-command            6127        1.0982729999  0.0001792513
font-latex-match-math-env                  7440        1.046902      0.0001407126
font-latex-match-bold-command              5035        0.9353680000  0.0001857731
font-latex-match-italic-declaration        4971        0.8511369999  0.0001712204
font-latex-match-math-command              4968        0.7239129999  0.0001457151
font-latex-match-type-command              4968        0.6760849999  0.0001360879
font-latex-match-quotation                 5845        0.6286879999  0.0001075599
font-latex-match-script                    4968        0.0059630000  1.200...e-06

--=-=-=


Here is an example of a session without the slow down:


--=-=-=
Content-Disposition: attachment; filename=font_latex_cvs_okay_01.elp

Function Name                              Call Count  Elapsed Time  Average Time
=========================================  ==========  ============  ============
font-latex-match-command-with-arguments    29220       1.9291889999  6.602...e-05
font-latex-match-function                  7523        0.8769339999  0.0001165670
font-latex-match-reference                 5735        0.7140709999  0.0001245110
font-latex-find-matching-close             9490        0.3208210000  3.380...e-05
font-latex-match-textual                   1962        0.1984190000  0.0001011309
font-latex-match-title-4                   1588        0.1721749999  0.0001084225
font-latex-match-math-envII                2606        0.1612890000  6.189...e-05
font-latex-match-command-in-braces         4668        0.1379649999  2.955...e-05
font-latex-match-bold-declaration          1517        0.1323289999  8.723...e-05
font-latex-match-warning                   4009        0.1299239999  3.240...e-05
font-latex-commented-outp                  10744       0.1270179999  1.182...e-05
font-latex-match-title-3                   1636        0.1265909999  7.737...e-05
font-latex-match-title-2                   1604        0.1225590000  7.640...e-05
font-latex-match-type-declaration          1636        0.1011240000  6.181...e-05
font-latex-match-variable                  1518        0.1001359999  6.596...e-05
font-latex-match-italic-declaration        1515        0.0811380000  5.355...e-05
font-latex-faces-present-p                 11214       0.0800480000  7.138...e-06
font-latex-match-italic-command            1538        0.0795320000  5.171...e-05
font-latex-match-math-command              1514        0.0706309999  4.665...e-05
font-latex-match-type-command              1514        0.0702580000  4.640...e-05
font-latex-unfontify-region                1514        0.0391959999  2.588...e-05
font-latex-match-title-1                   1574        0.0382660000  2.431...e-05
font-latex-match-bold-command              1514        0.0278050000  1.836...e-05
font-latex-match-quotation                 1521        0.0217540000  1.430...e-05
font-latex-match-math-env                  1604        0.0199450000  1.243...e-05
font-latex-syntactic-face-function         6500        0.0067560000  1.039...e-06
font-latex-match-script                    1514        0.0018509999  1.222...e-06

--=-=-=


You can find some more results here:
http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/auctex/elp/

As I don't know if modifications in my document or changes in
`font-latex' trigger the slow down, I would like to ask if someone
(maybe Ralf) has an idea which revisions of `font-latex' I should
compare.

In other words: Is there a change which might be suspect to slow down
`font-latex-match-*' (especially
`font-latex-match-command-with-arguments') dramatically?

Bye, Reiner.

PS: Version info:

Emacs  : GNU Emacs 22.0.50.42 (x86_64-unknown-linux-gnu, GTK+ Version 2.4.9)
 of 2005-03-21 on bridgekeeper
Package: AUCTeX CVS-5.491 (2005-03-17)

Previously, I have observed the same slow down with Emacs 21.3 but I
can't trigger it right now (see font_latex_21-3_okay_1?.elp).
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

--=-=-=--