Ben Wing <ben(a)666.com> writes:
basically, the current approach is (time to move SOE) + O(M^2) where
M == number of extents overlapping the position in question. your
approach would be (time to move SOE) + O(M). usually M is very
small.
I think you're right. Rewriting g-t-p would speed things up, but not
noticably in the common case.
i.e. we're talking about differences in constant factors, not
anything related to the number of extents in the buffer. you still
aren't changing the fact that you're calling g-t-p at each position
in the buffer, so the biggest speedup would come from avoiding this
by clever caching. but if the call to g-t-p is dominating the
font-lock time, you could get it noticeably faster -- maybe 1.5 to 2
times if you're lucky.
Again, you're right. It would probably make sense to do both: speed
up g-t-p by calling map_extents directly, and not call it on every
character.
I'll try to tackle some of this when I have time.