[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Performance asymmetry with overlays
From: |
Luc Teirlinck |
Subject: |
Re: Performance asymmetry with overlays |
Date: |
Fri, 16 May 2003 19:51:45 -0500 (CDT) |
Apparently your particular test runs a lot faster with overlays
centered at point-max. I do not know whether that is really a general
rule, however. Somebody who knows more about the internal
implementation of overlays than I do should comment on that.
The folllowing variation on your test contains only one single added
line:
(overlay-recenter (point-max))
With this change, execution speed seems to be essentially independent
of the starting position.
(defun overlay-test ()
(interactive)
(let ((start (point-min))
(end (point-max))
ov)
(goto-char start)
(overlay-recenter (point-max))
(beginning-of-line)
(while (and (not (eobp)) (< (point) end))
(setq ov (make-overlay (point) (1+ (point))))
(overlay-put ov 'display overlay-test-string)
(forward-line))))