
On Thu, Sep 6, 2012 at 8:04 AM, Amy de Buitléir
Paul Visschers
writes: Looks nice. Does it scale well to millions of elements, and can it handle 3D?
The current implementation wouldn't scale well to millions of elements, but it shouldn't take much tweaking to support that. Currently, when a grid is constructed, the list of all possible indices is constructed as well, so that calls to the "indices" function are fast. To support large numbers of tiles, I would instead generate all possible indices only when the "indices" function is called. Then the indices function would be too slow to be usable for more than, say, 50,000 tiles. But perhaps you don't need that function.
It seems like you should be able to stick this behind some abstraction so that you can support multiple implementations for grids (i.e., currently storing indices as you mention, but could support other implementations with different trade offs ...)? kris