all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* extremely slow font-lock-mode
@ 2007-12-11 10:25 Martin Pohlack
  2007-12-11 22:32 ` martin rudalics
  2007-12-12  8:37 ` Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Pohlack @ 2007-12-11 10:25 UTC (permalink / raw)
  To: emacs-devel

Hi,

I'm experiencing very slow syntax highlighting with emacs-23.0.60
(GTK+ Version 2.12.1).

Simply scrolling in source files takes incredibly long (~ 1 second for
scolling one line backwards).  This is an a dual-core 2 GHZ machine
...

I tried to play with all font-lock and jit-lock customization options
but only turning font-lock off seemed to make a difference.

I tried to use elp to instrument relevant packages (mwheel, font-lock,
jit-lock, mouse, lazy-lock, fast-lock).  After some scrolling (~ 20
seconds, with pauses, mouse wheel, pg-keys and scrollbar) I get
the following results:

Function Name                      Call Count  Elapsed Time  Average Time
================================== ==========  ============  ============
mwheel-scroll                      62          4.060767      0.0654962419
jit-lock-function                  18          0.0083890000  0.0004660555
jit-lock-fontify-now               18          0.0082680000  0.0004593333
font-lock-fontify-region           18          0.007176      0.0003986666
font-lock-default-fontify-region   18          0.006962      0.0003867777
font-lock-fontify-syntactically-re 18          0.0042169999  0.0002342777
font-lock-fontify-keywords-region  18          0.0020000000  0.0001111111
jit-lock-context-fontify           21          0.0017679999  8.419...e-05
font-lock-mode                     14          0.0004470000  3.192...e-05
font-lock-unfontify-region         18          0.000194      1.077...e-05
mwheel-filter-click-events         55          0.0001699999  3.090...e-06
font-lock-prepend-text-property    32          0.0001610000  5.031...e-06
mwheel-event-button                62          0.0001379999  2.225...e-06
mwheel-event-window                62          0.0001349999  2.177...e-06
font-lock-default-function         14          0.0001119999  8e-06
mwheel-inhibit-click-timeout       7           0.000105      1.5e-05
font-lock-change-mode              2           9.5e-05       4.75e-05
font-lock-default-unfontify-region 18          6.500...e-05  3.611...e-06
font-lock-extend-region-multiline  18          4.5e-05       2.5e-06
font-lock-extend-region-wholelines 18          4.4e-05       2.444...e-06
font-lock-set-defaults             18          4.200...e-05  2.333...e-06
mouse-region-match                 1           6e-06         6e-06


So, mwheel-scroll seems to behave badly.   However, lots of the
problematic calls also seem to have been lost.  E.g., scrolling with
keyboard was also very slow and is not shown in the table.

I also noticed, that scrolling forward seems to go considerably faster
than scrolling backwards (maybe this has to do with syntax-driven
jit-lock?).

The results are twofold for me:

First, I don't seem to be using elp right or it is the wrong tool.
Ideally, I would like to use a /sampling/ profiler for emacs.
 - Is there such a thing that can look into running lisp code?
 - How should I be using elp differently for getting meaningful
   results?

Second, font-lock-mode is currently unusable for me.  I started emacs
with -q, so I don't think my local tweak are to blame.  emacs-22 on my
local machine is incredibly fast for the same file (also started with
-q).
 - What might be to blame here?
 - Do you need more details on any aspect of my machine configuration?

Cheers,
Martin Pohlack

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-12-12 11:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-11 10:25 extremely slow font-lock-mode Martin Pohlack
2007-12-11 22:32 ` martin rudalics
2007-12-12  0:21   ` Martin Pohlack
2007-12-12  4:25     ` Kenichi Handa
2007-12-12  8:22       ` Martin Pohlack
2007-12-12 11:06         ` Kenichi Handa
2007-12-12  8:37 ` Richard Stallman

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.