Btree question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Btree question

Justin Donaldson
Hi,

I was wondering if anyone had tried to do a BTree implementation in haXe yet.  I started working on one that would handle arbitrary objects (using a Float transform function passed as a variable), and I a question.  Is it still better/faster to use lists rather than arrays for iterating through very small sets of objects?  Would it make that big of a difference just using arrays of size 3-4 or so?

Eventually, I'd like to try and do an RTree that would allow for quick spatial indexing (for occlusion detection), and I'm trying the BTree to get used to some of the basics.

Thanks,
-Justin


--
Justin Donaldson
PhD Candidate, Informatics
Indiana University
http://www.scwn.net

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Btree question

Nicolas Cannasse
Justin Donaldson a écrit :
> Hi,
>
> I was wondering if anyone had tried to do a BTree implementation in haXe
> yet.  I started working on one that would handle arbitrary objects
> (using a Float transform function passed as a variable), and I a
> question.  Is it still better/faster to use lists rather than arrays for
> iterating through very small sets of objects?  Would it make that big of
> a difference just using arrays of size 3-4 or so?

When talking about performances, please specify the platform :)

Just a quick guess :
- Array should be faster for JS, Flash8 and I guess PHP as well
- List should be faster for Neko
- haxe.FastList should be faster for Flash9+

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Btree question

laurence taylor
colhx has a Binary Search Tree implementation with an arbitrary compare function. Try "haxelib install colhx".

On Tue, Nov 4, 2008 at 9:36 AM, Nicolas Cannasse <[hidden email]> wrote:
Justin Donaldson a écrit :

Hi,

I was wondering if anyone had tried to do a BTree implementation in haXe yet.  I started working on one that would handle arbitrary objects (using a Float transform function passed as a variable), and I a question.  Is it still better/faster to use lists rather than arrays for iterating through very small sets of objects?  Would it make that big of a difference just using arrays of size 3-4 or so?

When talking about performances, please specify the platform :)

Just a quick guess :
- Array should be faster for JS, Flash8 and I guess PHP as well
- List should be faster for Neko
- haxe.FastList should be faster for Flash9+

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org