8000 Consider allocating nodes in contiguous memory · Issue #1 · dongyx/libaca · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Consider allocating nodes in contiguous memory #1
Open
@goldsam

Description

@goldsam

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0