Skip to content

Stores tracker #2

Open
Open
@WinstonHartnett

Description

Stores TODO

  • Unboxed
  • Boxed
  • Compacted
  • Resource

Unboxed

Uses growable unboxed MVectors under the hood. Probably fastest of array-like component stores.

Boxed

Uses growable boxed MVectors under the hood. Might suffer from long-term cache locality problems. Also has GC performance problems for large stores (due to card table).

Compacted

The idea is to provide a [mostly] contiguous store for long-lived boxed components (excluding functions and mutable data as per compact). A compact store is divided into compact-region chunks. On mutation (which should be avoided at all costs for preexisting components), a master record list w/ pointers to each chunk element from every chunk is updated to point to copies of the mutated chunk (with the mutated element(s) changed). Old references will still keep old blocks alive... beware!

Question: is copying on any modification a good idea? Maybe have some internal fragmentation heuristic?

Resource

Basically a global IORef.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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