On Thu, Mar 20, 2003 at 02:23:17PM +0000, John Levon wrote:
> This is (incorrectly) assuming that just splitting the thing into two
> doesn't mean we don't need to do things multiple times still.

Not more than once per redraw.

> > Secondly, why should it do the calculation twice?
> > The draw step consists only of "put string 'foo' at position 'pos'"
> 
> And where do these positions come from ? Cached ?

Cached from the previous metrics() run.

> AIUI that's not what mathed does. So, you end up doing all the metrics
> again during the draw.

draw() 
{
        metrics();
  real_draw(); 
}

> Or you cache it and have some *very* fragile
> semantics of when a cache should be cleared or not.

Maybe "cache" is the wrong word. It was originally intended as a cache but
as it turned out fast enough I decided not to try "real caching" and
instead re-calculate on each draw(). However, using it as a cache is
possible, and I had it running at some point of time, the problem was the
"macro folding".

This is similar to line rebreaks in the outer world, so yes, real caching
might be difficult to achieve, but as "one shot cache" it just works fine.

Maybe I really should not call it 'cache'.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to