From: "Tobias C. Rittweiler" <tcr@freebits.de>
To: emacs-devel@gnu.org
Subject: Re: Low redisplay performance (23 regression)
Date: Wed, 29 Apr 2009 19:35:52 +0200 [thread overview]
Message-ID: <87skjrz7k7.fsf@freebits.de> (raw)
In-Reply-To: jwvljpjwqas.fsf-monnier+emacs@gnu.org
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > 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.
Yes, I meant to write on large defuns. I test this on a file which
contains defuns spanning up to 500-600 lines.
> 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.
Find the below profiling outputs. The first is for Emacs 22.1.1, the
second for 23.0.92.1 (checked out, and built today.)
I used `elp' to do the profiling. I profiled the slime package, the
font-lock package, and the jit-lock package. As well as
`beginning-of-defun', `beginning-of-defun-raw', and `end-of-defun'.
Then I open a file, and scroll down to the end using Page Down.
(`slime-extend-region-for-defun' is a font-lock extend-region function
which calls `slime-region-for-extended tlf-at-point' which in turns call
`slime-region-for-tlf-at-point' which calls `end-of-defun' once, and
`beginning-of-defun' several times. `slime-search-suppressed-forms' is a
marker function on `font-lock-keywords'.)
You'll see in the profiling output that basically all functions run
slower on 23.x. It's still fast enough except for the extreme cases of
defuns spanning over 500 lines.
I'm not sure how much you can do with this information. But I can concur
with the OP that there does seem to be a performance regression.
-T.
PS.
GNU Emacs 22.1.1
Function Name Call Count Elapsed Time Average Time
========================================================= ========== ============ ============
jit-lock-function 478 6.0523169999 0.0126617510
jit-lock-fontify-now 478 6.0471380000 0.0126509163
font-lock-fontify-region 478 5.9743459999 0.0124986317
font-lock-default-fontify-region 478 5.9653550000 0.0124798221
slime-extend-region-for-font-lock 954 2.8670120000 0.0030052536
font-lock-fontify-keywords-region 478 2.2039999999 0.0046108786
slime-region-for-tlf-at-point 924 1.9189019999 0.0020767337
end-of-defun 1848 1.6501459999 0.0008929361
slime-region-for-extended-tlf-at-point 461 1.213281 0.0026318459
slime-search-suppressed-forms 922 1.0144610000 0.0011002830
font-lock-fontify-syntactically-region 478 0.747676 0.0015641757
beginning-of-defun-raw 4233 0.5864199999 0.0001385353
beginning-of-defun 2382 0.5515089999 0.0002315319
slime-forward-sexp 220 0.0974470000 0.0004429409
slime-forward-cruft 220 0.0939059999 0.0004268454
slime-eval-feature-conditional 444 0.0917369999 0.0002066148
slime-lisp-features 444 0.0813829999 0.0001832950
slime-forward-blanks 220 0.0522439999 0.0002374727
font-lock-extend-region-wholelines 954 0.0449930000 4.716...e-05
slime-forward-any-comment 220 0.0356580000 0.0001620818
font-lock-unfontify-region 478 0.0288390000 6.033...e-05
font-lock-default-unfontify-region 478 0.0204609999 4.280...e-05
slime-pre-command-hook 106 0.0053909999 5.085...e-05
slime-connection 444 0.0053260000 1.199...e-05
font-lock-extend-region-multiline 954 0.0042749999 4.481...e-06
slime-keywordify 444 0.0030740000 6.923...e-06
slime-connected-p 922 0.0023909999 2.593...e-06
font-lock-set-defaults 484 0.0016050000 3.316...e-06
jit-lock-context-fontify 7 0.0012900000 0.0001842857
slime-forward-reader-conditional 220 0.0011560000 5.254...e-06
slime-current-connection 444 0.0010020000 2.256...e-06
font-lock-mode 8 0.0009860000 0.0001232500
font-lock-default-function 8 0.0007859999 9.824...e-05
font-lock-mode-internal 2 0.000696 0.000348
slime-post-command-hook 106 0.0006859999 6.471...e-06
font-lock-turn-on-thing-lock 2 0.000424 0.000212
jit-lock-register 2 0.0003670000 0.0001835000
jit-lock-mode 2 0.000339 0.0001695
jit-lock-refontify 2 0.0003019999 0.0001509999
font-lock-compile-keywords 2 0.000188 9.4e-05
slime-lisp-mode-hook 1 7.9e-05 7.9e-05
font-lock-compile-keyword 32 6.7e-05 2.09375e-06
slime-mode 1 6.3e-05 6.3e-05
font-lock-change-mode 1 5.3e-05 5.3e-05
font-lock-add-keywords 2 4.6e-05 2.3e-05
slime-setup-command-hooks 1 3.4e-05 3.4e-05
slime-add-local-hook 2 2.100...e-05 1.050...e-05
font-lock-remove-keywords 2 2.100...e-05 1.050...e-05
font-lock-value-in-major-mode 5 1.1e-05 2.2e-06
font-lock-eval-keywords 2 9e-06 4.5e-06
slime-setup-first-change-hook 1 5e-06 5e-06
slime-add-easy-menu 1 4e-06 4e-06
font-lock-choose-keywords 1 3e-06 3e-06
------------------------------------------------------------
GNU Emacs 23.0.92.1
jit-lock-function 478 9.4705599999 0.0198128870
jit-lock-fontify-now 478 9.4663009999 0.0198039769
font-lock-fontify-region 478 9.4454880000 0.0197604351
font-lock-default-fontify-region 478 9.4372980000 0.0197433012
font-lock-fontify-keywords-region 478 4.463293 0.0093374330
slime-extend-region-for-font-lock 954 3.9002370000 0.0040882987
slime-region-for-tlf-at-point 924 2.8002330000 0.0030305551
end-of-defun 1848 2.5033839999 0.0013546450
slime-region-for-extended-tlf-at-point 461 1.6439540000 0.0035660607
slime-search-suppressed-forms 922 1.5033249999 0.0016305043
font-lock-fontify-syntactically-region 478 1.0036810000 0.0020997510
beginning-of-defun-raw 4233 0.4824060000 0.0001139631
beginning-of-defun 2382 0.4037609999 0.0001695050
slime-eval-feature-conditional 444 0.0967099999 0.0002178153
slime-lisp-features 444 0.0876879999 0.0001974954
slime-forward-sexp 220 0.0707279999 0.0003214909
slime-forward-cruft 220 0.0670999999 0.0003049999
slime-forward-any-comment 220 0.04091 0.0001859545
font-lock-unfontify-region 478 0.0276759999 5.789...e-05
slime-forward-blanks 220 0.0211710000 9.623...e-05
font-lock-default-unfontify-region 478 0.0208749999 4.367...e-05
slime-pre-command-hook 111 0.0053809999 4.847...e-05
slime-connection 444 0.0052940000 1.192...e-05
font-lock-extend-region-multiline 954 0.0036339999 3.809...e-06
font-lock-extend-region-wholelines 954 0.0034359999 3.601...e-06
slime-keywordify 444 0.0028710000 6.466...e-06
slime-connected-p 922 0.0023109999 2.506...e-06
font-lock-set-defaults 484 0.0016920000 3.495...e-06
jit-lock-context-fontify 7 0.001305 0.0001864285
slime-forward-reader-conditional 220 0.0010509999 4.777...e-06
slime-current-connection 444 0.0009630000 2.168...e-06
font-lock-mode 8 0.000752 9.4e-05
slime-post-command-hook 111 0.0006969999 6.279...e-06
font-lock-default-function 8 0.00055 6.875e-05
font-lock-mode-internal 2 0.000459 0.0002295
font-lock-compile-keywords 2 0.000271 0.0001355
font-lock-turn-on-thing-lock 2 0.000151 7.55e-05
jit-lock-register 2 9.6e-05 4.8e-05
font-lock-compile-keyword 32 8.500...e-05 2.656...e-06
jit-lock-mode 2 7.1e-05 3.55e-05
slime-lisp-mode-hook 1 6.7e-05 6.7e-05
slime-mode 1 5.9e-05 5.9e-05
font-lock-change-mode 1 5.2e-05 5.2e-05
font-lock-add-keywords 2 4.6e-05 2.3e-05
jit-lock-refontify 2 3.7e-05 1.85e-05
slime-setup-command-hooks 1 3.2e-05 3.2e-05
font-lock-remove-keywords 2 2.100...e-05 1.050...e-05
slime-add-local-hook 2 1.8e-05 9e-06
font-lock-eval-keywords 2 1.5e-05 7.5e-06
font-lock-value-in-major-mode 5 1.1e-05 2.2e-06
slime-setup-first-change-hook 1 5e-06 5e-06
font-lock-choose-keywords 1 4e-06 4e-06
slime-add-easy-menu 1 3e-06 3e-06
next prev parent reply other threads:[~2009-04-29 17:35 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-20 21:58 Low redisplay performance (23 regression) David Reitter
2009-04-20 22:31 ` Deniz Dogan
2009-04-20 22:33 ` Chong Yidong
2009-04-20 23:20 ` David Reitter
2009-04-21 3:15 ` Eli Zaretskii
2009-04-21 12:36 ` Juanma Barranquero
2009-04-21 13:51 ` David Reitter
2009-04-21 14:20 ` Juanma Barranquero
2009-04-21 18:58 ` Eli Zaretskii
2009-04-21 19:07 ` Eli Zaretskii
2009-04-21 23:24 ` Juanma Barranquero
2009-04-21 20:19 ` David Reitter
2009-04-21 20:53 ` Chong Yidong
2009-04-21 22:15 ` David Reitter
2009-04-22 15:30 ` Daniel Clemente
2009-04-22 15:50 ` David Reitter
2009-04-22 16:28 ` Chong Yidong
2009-04-22 18:26 ` David Reitter
2009-04-23 13:34 ` Willem Rein Oudshoorn
2009-04-23 22:45 ` Miles Bader
2009-05-06 13:28 ` Willem Rein Oudshoorn
2009-04-22 22:58 ` YAMAMOTO Mitsuharu
2009-04-23 1:01 ` ftx font driver [Re: Low redisplay performance (23 regression)] Kenichi Handa
2009-04-23 7:31 ` YAMAMOTO Mitsuharu
2009-04-23 11:22 ` Kenichi Handa
2009-04-23 12:38 ` Chong Yidong
2009-04-23 14:56 ` Stefan Monnier
2009-04-24 1:09 ` Kenichi Handa
2009-04-24 2:01 ` Stefan Monnier
2009-04-24 3:52 ` Chong Yidong
2009-04-25 14:38 ` Chong Yidong
2009-04-21 23:16 ` Low redisplay performance (23 regression) Juanma Barranquero
2009-04-21 14:56 ` William Xu
2009-04-21 15:30 ` David Reitter
2009-04-22 14:25 ` William Xu
2009-04-29 10:17 ` Tobias C. Rittweiler
2009-04-29 11:54 ` David Reitter
2009-04-29 13:33 ` Stefan Monnier
2009-04-29 17:35 ` Tobias C. Rittweiler [this message]
2009-04-29 20:20 ` Stefan Monnier
2009-04-30 7:34 ` Tobias C. Rittweiler
2009-04-30 20:00 ` Stefan Monnier
2009-04-30 20:34 ` Tobias C. Rittweiler
2009-04-29 18:01 ` Tobias C. Rittweiler
2009-04-29 17:40 ` Tassilo Horn
2009-04-29 17:49 ` David Reitter
2009-04-29 18:21 ` Tassilo Horn
[not found] ` <14FF0914-56BA-41D6-85DA-A4024694CF75@gmail.com>
2009-04-29 19:45 ` Tassilo Horn
2009-04-29 18:45 ` Chong Yidong
2009-04-30 2:46 ` YAMAMOTO Mitsuharu
2009-04-30 3:49 ` Chong Yidong
2009-04-30 6:27 ` YAMAMOTO Mitsuharu
2009-04-29 22:10 ` Miles Bader
2009-04-30 5:05 ` Chong Yidong
2009-04-30 7:53 ` Tobias C. Rittweiler
2009-04-30 9:37 ` Tassilo Horn
2009-04-30 12:44 ` David Reitter
2009-04-29 18:38 ` Dan Nicolaescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87skjrz7k7.fsf@freebits.de \
--to=tcr@freebits.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.