Map Performance

Implemented and investigated ways to improve map performance are documented in this directory.

Documents

Current improvements

The plant layer uses viewport culling so that only plantings inside the visible map area are rendered.

For larger maps, an RBush spatial index is used to reduce the cost of finding plantings inside the viewport. For smaller maps, the plant layer continues to use linear filtering because constructing and querying a spatial index also introduces overhead.

Investigations into event handling, drawing-layer polygons, React and Konva updates, and plant image loading are documented separately.

Suggested future investigations

Further investigation is still needed for long editing sessions.

Performance degradation over longer editing sessions had been reported before, but it was not observed during the current investigation.

Other possible improvements include:

  • adding application performance monitoring, for example with SigNoz, to observe performance during longer editing sessions;
  • checking which other layers still use linear scans for viewport selection;
  • investigating whether other layers could benefit from spatial indexing;
  • checking whether visually complex layers become expensive, including drawing polygons, shade elements, and similar content;
  • reducing unnecessary React or Konva updates if future profiling shows that they become relevant;
  • investigating whether dynamic plant icon preview sizes should be implemented;
  • verifying whether plant icons continue to be cached effectively if the image-loading implementation changes.