[Top][All Lists]

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

Performance asymmetry with overlays

From: Satyaki Das
Subject: Performance asymmetry with overlays
Date: Fri, 16 May 2003 16:10:13 -0700

There seems to be an asymmetry in performance when overlays are
used depending on initial cursor position in a buffer. Here is a
test that demonstrates it:

0. Save the attached file as overlay-test.el

1. Start emacs with:
      emacs -q --no-site-file -l overlay-test.el

2. Open a large file. I tried this with the NEWS file by doing:
      C-h n

3. Go to the end of the buffer (with M->) and do:
      M-x overlay-test RET
   It runs very quickly (on my 800MHz Pentium 3 it takes 0.22 sec)

4. Remove the overlays with: M-x overlay-test-reset.

5. Go to the beginning of the buffer and run overlay-test again.
   This time it takes about 71.5 sec!

[I got the times by using elp]

I am running CVS Emacs from yesterday on a Redhat GNU/Linux 9.0
on a Pentium 3. I get similar results with Emacs-21.3.1 built on
the same machine. I also tried on a different Solaris machine
with Emacs-21.2 and got similar results.

I did profile overlay-test. It seems that when cursor is at top of
the buffer initially, make-overlay and forward-line both take much
longer than in the other case.

Can this be improved?


Attachment: overlay-test.el
Description: Test for Overlays

reply via email to

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