You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible that removing fields conditionally (and thereby making all the nodes not have homogeneous shapes) could hurt performance due to JIT inline caching, so it's worth benchmarking after this to make sure there's not a regression.
That's a good point. If it does wind up being slower then having two different classes may be a better option? One with children and one with tris?
I'll also have to see how much removing a key really saves here. I'm not so familiar with how to estimate memory use when it comes to javascript object keys.
No idea if the objects having the same prototype will make a difference or not.
Removing children is particularly appealing since for leaf nodes it's an empty array, so we're paying memory twice -- once for the pointer and once for the empty array. tris is just null for non-leaves so we only pay for the pointer.
Tons of nodes get created so any reduction we can make per object (even empty dictionary keys) may be worthwhile.
_mesh
does not necessarily need to be a pointer on every node.children
can be removed if the node is a leaf node (or only be added if it's an internal one)tris
can be removed if the node is an internal node.The text was updated successfully, but these errors were encountered: