JuliaGeometry / KDTrees.jl

KDTrees for julia
Other
25 stars 8 forks source link

Memory used in creating the tree #2

Closed KristofferC closed 9 years ago

KristofferC commented 9 years ago

The n_th element sorting here:

https://github.com/KristofferC/KDtree.jl/blob/master/src/kd_tree.jl#L171

allocates a new anonymous function in each iteration. We therefore create ~ 2 * n_points anonymous functions which currently is using almost all the memory required to create the tree.

KristofferC commented 9 years ago

https://github.com/KristofferC/KDtree.jl/commit/6d8829c1611f449dfd82b0a21c11fd15c90535de should fix this in an inelegant way.