Closed Pierre-ZACHARY closed 1 month ago
I think this is expected because creating the immutable tree does more work.
From the release notes: "ImmutableKdTree balances and optimises the tree at construction time, ensuring much more efficient memory usage (and a correspondingly smaller size on-disk for serialized trees)."
Hi, @acshi is correct here. The ImmutableTree
achieves a smaller memory footprint and more efficient query at the cost of increased construction time.
I see; I was thinking it should be around the same, tho I can't even construct the immutable tree past 300+ division, seems exponential; for 500 divisions the kdtree takes 1.7s on my computer / i7 8th; immutable timed out after 5 min
Hello! I think I've found a usecase where the immutable tree is slower than mutable one ..?
I'm trying to build a kdtree from 3D points on a sphere
I'm not too sure if I'm doing something wrong here
You can easily reproduce with this code snippet :
KdTree Construction complete. (107.4033ms) Immutable Construction complete. (1.0911594s)