[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Slow fontification in C mode buffers
From: |
Eli Zaretskii |
Subject: |
Slow fontification in C mode buffers |
Date: |
Sat, 03 Dec 2011 15:19:47 +0200 |
Did anyone else notice that scrolling the first time through a very
large comment in C mode became extremely slow lately? For example,
visit xdisp.c in "emacs -Q", type M-<, then hit C-v several times in
quick succession. Then watch in disbelief how long it takes for Emacs
to scroll by these several screenfuls. In my case (6.5 year old
hardware), I even see the "hourglass cursor" kick in, and the CPU
meter shows 100% utilization of one execution unit for about 5
seconds.
If you then type M-< and again hit C-v several times, scrolling will
be at its usual speed. Scrolling outside of large comments is also
reasonably fast, even for the first time.
Therefore, my prime suspect is font-lock, which is triggered by the
need to display a portion of the buffer that was not fontified yet.
This suspicion is corroborated by the fact that jit-stealth font-lock
of xdisp.c causes extremely high peaks of CPU usage, and Emacs
response time becomes very sluggish.
Is there something in C Mode's arrangements for fontification,
specifically related to comments, that was changed lately and that can
explain this slowdown?
- Slow fontification in C mode buffers,
Eli Zaretskii <=