emacs-devel
[Top][All Lists]
Advanced

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

Re: Stealth fontification GCs a lot


From: Ralf Angeli
Subject: Re: Stealth fontification GCs a lot
Date: Fri, 15 Apr 2005 11:12:37 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

* Eli Zaretskii (2005-04-15) writes:

>> From: Ralf Angeli <address@hidden>
>> Date: Thu, 14 Apr 2005 13:25:27 +0200
>> 
>> A worse annoyance of stealth fontification is that this happens
>> again and again after every modification of the buffer.
>
> In practice, such re-fontification ends very quickly.  So I don't
> understand why it is an annoyance for you; can you give a specific
> example?

I mostly seeing this in large LaTeX files.  As an example, create a
new .tex file and copy the following lines repeatedly without blank
lines in between into the buffer until you have, say, 10.000 lines:

\newcommand{\mycontent}{\ensuremath{\lambda_{1}}}%
\begin{itemize}%
\item
  \begin{align*}%
    \left\{
      \begin{array}{l}
        b_{c} \text{some long line with $\mycontent$}
      \end{array}
    \right\}
  \end{align*}%
\end{itemize}%

If you want to test this in clean room conditions, save the file,
start an Emacs instance with `emacs -Q', open the file, type `M-x
font-lock-mode RET' and wait.  It's good to have something handy for
monitoring the CPU usage, e.g. top or the CPU meter of GKrellM.  Now
wait for a few seconds until the initial stealth fontification starts.
You should see that CPU usage is growing until the whole buffer is
fontified.  In order to see the effect of re-fontification after a
change (which is done only from the point of change downwards and not
for the whole buffer as already mentioned in the reply to Richard),
insert a random character somewhere at the start of the buffer and
wait again until stealth fontification starts.  This second
fontification pass takes nearly as long as the first because of the
change in the buffer happening near its top.

-- 
Ralf




reply via email to

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