[Top][All Lists]

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

Re: Overlay mechanic improvements

From: Eli Zaretskii
Subject: Re: Overlay mechanic improvements
Date: Sun, 21 Sep 2014 19:56:39 +0300

> From: Stefan Monnier <address@hidden>
> Date: Sun, 21 Sep 2014 12:07:48 -0400
> Cc: David Kastrup <address@hidden>, address@hidden
> We rarely suffer from overlay's performance issues because most codes
> that could suffer from it simply avoid using overlays (or they try to
> minimize the number of overlays used, e.g. by flushing those overlays
> currently not visible), even when they would be the right tool.  Or they
> add calls to overlay-recenter when the performance problem is diagnosed.

We should distinguish between 2 use cases here.  One is when overlays
need to be displayed.  In that case, indeed only the overlays in the
visible region count, which are normally not too many, and the display
engine already does the equivalent of overlay-recenter for each
display line.

The other use case is when some Lisp program, or even some part of
Emacs, needs to search for the next/previous change in character
properties, or find the beginning or end of an overlay.  In those
cases, you cannot assume that only the visible portion of a buffer
matters, so in large buffers with many overlays this could be rather

> I don't see any obvious reason why re-using the existing intervals.c
> tree wouldn't work well.

Overlays can overlap, while text properties cannot.  Does that matter
for what intervals.c implement?

reply via email to

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