Re: patch -- cache last searched frag


Subject: Re: patch -- cache last searched frag
From: Joaquín Cuenca Abela (cuenca@pacaterie.u-psud.fr)
Date: Fri Jul 06 2001 - 10:22:48 CDT


On 07 Jul 2001 00:51:49 +1000, Martin Sevior wrote:
>
>
> On Fri, 6 Jul 2001, Hubert Figuiere wrote:
>
> > According to Joaquín Cuenca Abela <cuenca@pacaterie.u-psud.fr>:
> >
> > > Anyway, I will ask to *not* yet commit this patch. I've only tested it
> > > slightly, and I've not yet been able to run a profiler in both,
> > > precached-abiword and cached-abiword. So please, hold your breath until
> > > I run a profiler and some more tests. And feel free to help with the
> > > tests! :-)
> >
> > Actually I commit it as per dom's request. This is the best way to get it
> > tested.
> > CVS: src/af/xap/xp/xad_Document.cpp src/text/fmt/xp/fv_View.h
> > CVS: src/text/ptbl/xp/pf_Frag.h src/text/ptbl/xp/pf_Fragments.cpp
> > CVS: src/text/ptbl/xp/pf_Fragments.h
> > CVS: src/text/ptbl/xp/pt_PieceTable.cpp
> >
>
> Sh*t!! Please put the areFragsClean() test into it. Sorry it is hard for
> me to work on the current sources now.
>
> I'm certain it will work with the areFragClean() method. I'm not certain
> it will work without it.

I'm pretty confident (but not 100% sure, let's say 90% sure) that it
works *without* checking the areFragClean() method.

In the findFirstFragBeforePos() (where the cache is confined), the
binary search without the cache is based in correct values for the "pos"
stored in each frag (values that may be false if the frag's vector is
dirty).

Ie, if the findFirstFragBeforePos worked before the cache, it should
work after the cache (I think that we're just laking a
UT_ASSERT(!areFragsDirty()) at the beginning of findFirstFragBeforePos).

Anyway, if you have problems and you suspect that they come from the
cache, just comment out lines 209 to 216 of pf_Fragments.cpp. That
should turn the cache off.

Cheers,

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



This archive was generated by hypermail 2b25 : Fri Jul 06 2001 - 10:22:26 CDT