[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz] Why Pair keys?!?
From: |
Tuomas Lukka |
Subject: |
[Gzz] Why Pair keys?!? |
Date: |
Wed, 30 Jul 2003 14:57:16 +0300 |
User-agent: |
Mutt/1.5.4i |
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?
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..
Tuomas
- [Gzz] Why Pair keys?!?,
Tuomas Lukka <=