--- Tomas Frydrych <[EMAIL PROTECTED]> wrote:
> 
> The updateBackgroundColor mechanism seems to be very
> seriously 
> flawed and needs to be rewritten, as it is one of
> the main bottlenecks 
> in the code.
> 
> The problem is this: the various calls to
> updateBackgroundColor() 
> propagate down to the run level, where 
> fp_Run::updateBackgroundColor() querries the
> PieceTable (!!!) for 
> the background colour property. This is not the way
> it should be -- 
> *the only* place the runs should ever querry the PT
> for properties is 
> ::lookupProperties() which in turn is only to be
> called in response to 
> formatting changes in the PT.
> 
> If the background colour needs to change because the
> PT has 
> changed, then let it be done in ::_lookupProperties;
> if the PT has not 
> changed, then the updateBackground colour has no
> business of 
> querring the PT. So my question is why do we need 
> updateBackground() colour at all?

I don't aim to reply such a transcendental question,
but I have a fix to remove almost all the
updateBackground() calls in my computer.

Basically, we call it each time a run changes from one
page to another one, and due to bumpContainers, that
happens many times (remember the N^2/2 factor that I
explained some time ago).

I remove these calls (along with other superfluous
calls) if we move a run from page a to page b, and
page a and page b both have the same width and the
same color.  If that happens I not only cut
updateBackground, but also some other
fp_Line::setMaxWidthIDontRememberTheExactName stuff
(that afair was also doing some fp_Run calls).

That + a little cache in fp_Run to handle the obvious
case where the new page changes the width, but keeps
the same color removes all the superflous calls to
updateBackgroundColor.

I will try to sync my tree with cvs asap.

Btw, can somebody please increase a bit the frecuency
of the cvs snapshots?  1 day is a bit too long...

Cheers,


=====
Joaquin Cuenca Abela
[EMAIL PROTECTED]

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

Reply via email to