fenfire-dev
[Top][All Lists]
Advanced

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

Re: [Fenfire-dev] text cloud needs speed up


From: Tuomas Lukka
Subject: Re: [Fenfire-dev] text cloud needs speed up
Date: Tue, 28 Oct 2003 00:12:51 +0200
User-agent: Mutt/1.5.4i

On Mon, Oct 27, 2003 at 09:56:01PM +0200, Matti Katila wrote:
> 
> I added this to GLVobCoorder_Base:
> 
> 
>     public int[] getAllCSAt(int parent, float x, float y) {
>       if(dbg) pa("getCSAt "+parent+" "+x+" "+y);
>       int[] inds = GL.getAllCSAt(ninds, this.inds, floats, parent, x, 
> y);
> 
> 
>       int[] retInts = new int[0];
> 
>       for(int i=0; i<inds.length; i++) {
>           if(isNearestActiveAncestor(inds[i], parent)) {
>               // create a new array
>               int tmpInts[] = new int[retInts.length + 1];
>               System.arraycopy(retInts, 0, tmpInts, 0,retInts.length);
>               tmpInts[retInts.length] = inds[i];
>               retInts = tmpInts;
>           }
>       }
>       return retInts;
>     }
> 
> but for some reason text clouds seems to be too slow, so i made a small 
> loop:
> 
>      p('start')
>      for i in range(10000):
>          node = self.getNodeOnPlane(vs, ev, self.node)
>      p('done')
> 
> 
> takes more than 15 seconds, where getNodeOnPlane is basicly
> 
>    ints = vs.coords.getAllCSAt(cs, ev.getX(), ev.getY())
> 
> of jython code.
> 
> 
> So, where's the bottleneck?

In the C++ coords code, probably. 

Of course, to make sure, you should explicitly check that call by itself.

GL.getAllCSAt() can be rather slow
for a large vobscene, as it is linear in the number of coordinate systems.
There are several ways to speed it up, by saving the constructed objects
between invocations, for example, or through the recursive vobscenes ideas
where it would be possible to save the entire structure.

        Tuomas




reply via email to

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