"Stephen J. Turnbull" wrote:
>>>>> "Hrvoje" == Hrvoje Niksic <hniksic(a)arsdigita.com>
writes:
Hrvoje> I might be misreading the code, but to me this indicates a
Hrvoje> possibility that get-text-property requires time
Hrvoje> proportional to n^2, where n is the number of extents in
Hrvoje> the buffer.
I haven't done a careful analysis of extent_at_byteind, but note the
"prior" argument in the call to extent_at_byteind:
while (1)
{
extent = extent_at_bytind (position, object, Qtext_prop, prior,
fl, 0);
if (NILP (extent))
return Qnil;
if (EQ (prop, Fextent_property (extent, Qtext_prop, Qnil)))
break;
prior = XEXTENT (extent);
}
Ie, each extent gets visited once.
and we don't need to search from the beginning of the extent list each time to
find the next one, because the extent list is ordered. g-t-p is at worst
log(N)*# of extents overlapping a position.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Don't ask how you can "do" free software business;
ask what your business can "do for" free software.