Stephen J. Turnbull wrote:
>>>>>"Ben" == Ben Wing <ben(a)xemacs.org>
writes:
>>>>>
>>>>>
Ben> it's also still possible it's the text property
Ben> implementation. i know that the extent code works very badly
Ben> in the presence of a single extent that covers the entire
Ben> buffer
Urk. A text property is the obvious way to implement
language-dependent behavior, of course. It's really ugly to have a
buffer property that's actually a text property just because
performance sucks when an extent covers the whole buffer.
what do you mean? as i said before, i have mostly finished code that
will make text properties efficient by implementing them entirely in
non-overlapping intervals, as fsf does.
the problem with an extent covering the entire buffer is that it causes
the "stack of extents" [soe] caching mechanism that determines which
extents cover a particular position to entirely break down. i think the
problem is that the current algorithm at least needs to examine all
extents within the boundaries of the union of all extents covering the
current position in order to find the correct set of extents overlapping
an adjacent position. when there is an extent covering the whole
buffer, all soe operations have to scan all extents in the buffer. i'm
sure there are more sophisticated data structures to help with this
problem, but in general this is a very tough problem, and using simpler
solutions when possible (e.g. non-overlapping text properties). it
might be possible to simulate extents in general using non-overlapping
intervals, where multiple intervals could represent a single extent and
each interval contains parts of all extents crossing over them. this
interval would be guaranteed efficient and not too hard to implement, i
think -- in fact it's the same algorithm i'd be using for
text-properties, and could be extended to extents in general.
but first we need some more profiling data.
redisplay and certain other operations need to know about all extents
covering a particular position, which is cached using a structure.
map-extents, for example, when told to map over all extents overlapping
a region, uses the soe structure to determine the bounds within which it
needs to look. but when one extent covers the entire buffer, the
current code that maintains the soe and moves it to adjoining buffer
positions breaks down at least it is impossible to maintain the the
caching info from the soe will be useless, and it will always have to
uses ; but an extent over the entire buffer essentially invalidates
this cache, since updating it requires looking over