Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate placement grid to use linked lists instead of arrays #6

Open
shyndman opened this issue Jan 25, 2020 · 1 comment
Open

Migrate placement grid to use linked lists instead of arrays #6

shyndman opened this issue Jan 25, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@shyndman
Copy link
Owner

As it stands, big grids with sparsely placed items will use a lot more memory than they should, as the placement grid is represented as a 2D array, one element per cell, whether or not that cell is filled.

Chrome's implementation uses a LinkedList, and skips past empty regions. It could be used as a model for how ours should work.

@shyndman shyndman added the enhancement New feature or request label Jan 25, 2020
@shyndman shyndman changed the title Migrate placement to use linked lists instead of arrays Migrate placement grid to use linked lists instead of arrays Jan 25, 2020
@nicoburns
Copy link

An easier way to reduce memory usage might be to use a Uint8List to represent the placement grid. That way you'll still have an element for every cell, but each element will only be 1 byte each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants