Re: patch -- cache last searched frag


Subject: Re: patch -- cache last searched frag
From: Joaquín Cuenca Abela (cuenca@pacaterie.u-psud.fr)
Date: Sat Jul 07 2001 - 14:28:16 CDT


On 06 Jul 2001 16:18:11 -0700, Paul Rohr wrote:
> At 02:49 PM 7/6/01 +0200, Joaquín Cuenca Abela wrote:
> >I've been taking a look at our pf_Fragments, and after some UT_DEBUGMSG
> >I've seen that the searches for pf_Frag's are very (*very*) local. So
> >I've added a little cache (of only 1 element) to this class.
>
> Yay! When Jeff and I originally designed the piece table, this is the exact
> optimization we thought would be most promising, but we decided to wait
> until we had enough real-world profile data to prove it was worth it.

And if I may say it, you took the right decision. I was attracted by a
working (even if slower) wp. I was not attracted by a wp with a fast
piece table in which I cann't write...

> At the time (circa 0.1.1) we were still working to get on-screen editing
> working *at all* inside paragraphs, and getting across block boundaries into
> paragraph two or three was still a future TODO.
>
> Boy we've come a long way since then, huh? ;-)

you can say it! :-)

> Paul
>
> PS: If anyone wants to have even more fun with their profiler, it might be
> interesting to experiment with various caching strategies and see how they
> compare.

I'm trying to find if it's worth the effort to look for the next frag
(relative to the cached frag) when the cache fails. One of the most
used operations is the repaint of the screen (it's called to do the
scroll, when the document changes, etc.). If abi queries the frags that
it needs to fill the screen in a liner fashion, starting from the
top-left corner and finishing in the bottom-right corner, we could serve
all the needed frags doing only a single binary search (for the first
frag).

Anyway, my local copy is doing weird things (I'm putting big
printf("BOOOOOOOOOOOOOOOOOOOOOOOOOOOHHH"); at the constructor of
pt_PieceTable and I'm not seeing anything) and I have a plane to take
tomorrow, so it may take 3-4 days until I can finish the performance
tests... (the "good" news is that when I will back at home I will test
abi in a (glup) Pentium 100Mhz, so the I should be able to find any
eventual bottleneck in current code :)

Cheers,

--
Joaquín Cuenca Abela
cuenca@celium.net



This archive was generated by hypermail 2b25 : Sat Jul 07 2001 - 14:27:47 CDT