emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock and syntax-ppss


From: Stefan Monnier
Subject: Re: font-lock and syntax-ppss
Date: Thu, 01 Nov 2001 17:48:18 -0500

> on a 400MHz nt4sp6 box (random activity: mail, elisp, C)
> 
> Function Name   Call Count  Elapsed Time  Average Time
> ==============  ==========  ============  ============
> font-lock-ppss  3665        110.086       0.0300371077
> syntax-ppss     3665        17.128999999  0.0046736698

Cool!  It means my function was more than 5 times faster ;-)

> on Solaris 2.5.1 (large C file, font-lock on)
> 
> Function Name   Call Count  Elapsed Time  Average Time
> ==============  ==========  ============  ============
> font-lock-ppss  440         316.355345    0.7189894204
> syntax-ppss     418         3.814958      0.0091266937

Wow, 78x!  This is even better.  Was it a large C file consisting mostly
of a single function ?  Or maybe the functions look like

   foobar (arg) {

rather than

   foobar (arg)
   {

I.e. if you do M-x beginning-of-defun RET, do you end up at
the beginning of the file (or close enough) ?

> I must admit that I am not sure I quite understood your message.

I was mostly asking for you to do M-x elp-results RET and if the
results showed syntax-ppss to be slower, to tell me.  In your
case, syntax-ppss is much faster, which makes me very happy,
but is the case I don't need to worry about.

At the same time, the performance differences you show here are
much higher than what I get, so I'm wondering whether it's really
syntax-ppss doing great or whether there's something else at play.
If beginning-of-defun jumps you to the beginning of that 20KLOC
file, then I'm not completely surprised (it's a very unfavorable
situation for font-lock), although a factor of 78 still sounds
suspiciously high.
Are you sure your font-lock is byte-compiled ?

Also the fact that font-lock-ppss is called more often (440 times)
than syntax-ppss (418 times) is very strange.
 
> I noticed that Emacs is noticeably slow when indenting a large C file
> (~20,000 lines). It takes more than a second before Emacs responds to
> TAB (whether font-lock is on or off).

But that was the case in Emacs-21.1 (and Emacs-20 for that matter)
as well, right ?  I mean it's not related to this new syntax-ppss thing.


        Stefan




reply via email to

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