gzz-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gzz] Why Pair keys?!?


From: Matti Katila
Subject: Re: [Gzz] Why Pair keys?!?
Date: Wed, 30 Jul 2003 19:29:53 +0300 (EEST)

On Wed, 30 Jul 2003, Tuomas Lukka wrote:
> CVS says that benja or mudyc is the author of the following code in 
> CanvasView2D
> (I'm not sure)
> 
>       while (iter.hasNext()) {
>           Object n = iter.next();
>           if (dbg) p("placeable object: "+n);
>           org.nongnu.libvob.lava.placeable.Placeable p = 
>                   
> (org.nongnu.libvob.lava.placeable.Placeable)nodeView.f(fen.constgraph, n);
> 
>           int cs = vs.coords.orthoBox(paper2screen, 0,1,2,3,4,5,6);
>           vs.matcher.add(matchingParent, cs, new Pair(container, n));
>           vs.activate(cs);
> 
>           if(cull) {
>               cs = vs.cullCS(cs, "CULL", box2screen);
>           }
>           p.place(vs, cs);
>         }
> 
> 
> Generating new Pair objects
> in the innermost loop for all nodes is *not* acceptable.
> It makes view generation much less efficient and gives a lot more work
> to the GC, which is especially an issue on kaffe.
> 
> Could the author please explain why this is necessary?

Tested it and using:
   vs.matcher.add(matchingParent, cs, n);
didn't work, perhaps the key is already used in somewhere.
It can be that  
   vs.matcher.add(matchingParent, foo, container);
doesn't either work..

> I'm sure we can find a way around this, such as going to 
> a hierarchical structure with the matchingParent, i.e. first
> one dummy coordsys after matchingParent with the container as the key
> and after that, the node..

Please be handy and fix it. It would be a good lesson for me to understand 
the VobMatcher.


   -Matti





reply via email to

[Prev in Thread] Current Thread [Next in Thread]