Skip to content

Storing arrays in large dynamic buffers #42

@popcron

Description

@popcron

Right now with how arrays are implemented for entities, if there are 20 entities with a char array, thats 20 unique array instances (allocations).

This issue is for refactoring how they're stored so that a single giant buffer is created for each array type. And when an array is created on an entity, a region from the buffer is consumed. Letting those 20 entities still have their own array, but the underlying allocation is a single one.

This gives them these qualities:

  • arrays could be acessed more efficiently
  • significantly less memory fragmentation
  • slower to modify length

Some more details on the refactor:

  • arrays will behave like lists
    • when capacity needs to increase, other regions will be shifted
  • maybe new constructs to contain arrays, because their region within the buffer may change as its passed around
  • the type used for accessing the array will likely be a ref struct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions