shyndman / flutter_layout_grid

A grid-based layout system for Flutter, inspired by CSS Grid Layout
MIT License
438 stars 42 forks source link

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

Open shyndman opened 4 years ago

shyndman commented 4 years ago

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.

nicoburns commented 1 year ago

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.