Partially addresses some performance issues by adding a hashmap of edges to the geometry objects. This allows the helper function edgeById to run in ~O(1) time - which is called many times when deleting spaces.
This is not the ideal solution as it replicates state in the store (in geometry.edges and geometry.edgesMap), but is a good first step with improved performance. The following step would be to consider refactoring geometry.edges array into an array of id's
Changes/Additions
tests: refactor examples and some tests to use new geometry structure
geometry/mutations: add/update/delete entries in edgesMap whenever edges are changed
geometry/helpers: make sure functions are using the new structure when returning geometry objects
Partially addresses some performance issues by adding a hashmap of edges to the geometry objects. This allows the helper function
edgeById
to run in ~O(1) time - which is called many times when deleting spaces.This is not the ideal solution as it replicates state in the store (in geometry.edges and geometry.edgesMap), but is a good first step with improved performance. The following step would be to consider refactoring geometry.edges array into an array of id's
Changes/Additions