mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Improve performance of symbol placement with globe

Open karimnaaji opened this issue 1 year ago • 0 comments

When globe is enabled, we use a mock DEM data source cache as a placeholder to leverage the draping architecture (in order to capture tiled texture to render as raster).

For most cases, globe is enabled without terrain exaggeration and makes use of this mocked mode by default. This PR reduces unnecessary workload related to DEM sampling under this code path, which improves placement time by up to ~20ms. This will have the effect of running placement more often as this is a task deferred across multiple frames using pauseable placement.

Another useful metric could to be count how many times placement has been run across a fixture in benchmap.

Full benchmark fixture run can be seen at: https://sites.mapbox.com/benchmap-js-results/runs/834

Screenshot from 2022-07-21 13-08-35

Diagnostic metrics summary

sites mapbox com_benchmap-js-results_runs_834 (1)

Launch Checklist

  • [x] briefly describe the changes in this PR
  • [x] include before/after visuals or gifs if this PR includes visual changes
  • [x] post benchmark scores
  • [x] manually test the debug page
  • [x] apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • [x] add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Improve symbol placement performance with globe projection</changelog>

karimnaaji avatar Jul 21 '22 20:07 karimnaaji