Open
Description
I see that you incrementally allocate nodes on demand via malloc
. In many use cases you will know in advance how many nodes you need and could allocate them in contiguous memory. You would achieve considerable memory savings by eliminating the memory overhead of calling malloc
per node and by using 32-bit indices instead of 64-bit pointers . In addition to the memory savings, these changes would likely improved locality of reference (i.e. performance). Finally, nodes could be packed in contiguous memory in depth-first order (in an offline process) to further improve locality.
Any thoughts on these ideas?
Metadata
Metadata
Assignees
Labels
No labels