[Top][All Lists]

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

Re: Low redisplay performance (23 regression)

From: Stefan Monnier
Subject: Re: Low redisplay performance (23 regression)
Date: Wed, 29 Apr 2009 09:33:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

>   GNU Emacs 22.1.1     -->  (4.323907 2 0.07007399999999997)
>   GNU Emacs  -->  (7.5862680000000005 1 0.048462000000000005)
>   GNU Emacs  -->  (7.610763 2 0.06742599999999999)
>   (built on 2009-04-29)

So it's about twice as slow for this test, which is the expected in this
case: since your benchmark always calls it with point between 2 defuns,
it ends up doing: BOD-raw to find the previous defun, EOD-function to
find its end, which tells Emacs that the starting point was after the
previous defun, so it calls BOD-raw again to find the next defun and
finally EOD-function to get to its end.

> As I use `end-of-defun' in my customized
> `font-lock-extend-region-functions' this does have an impact on the
> overall performance of fontification for me on large files.

I don't think the size of the file (aka buffer) should make
a difference.  And I can't think of a good reason why EOD should take
a non-negligible amount of time compared to running
font-lock-fontify-region on a whole defun at a time.

> What is the reason that `end-of-defun' is an _order of magnitude_ slower
> than `beginning-of-defun'?

Because EOD uses BOD internally, I guess.  Of course in your
font-lock-extend-region-functions, you may simply prefer to use BOD
rather than EOD.


reply via email to

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