Improve performance of symbol placement with globe #12105
Merged
+86
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Diagnostic metrics summary
Launch Checklist
mapbox-gl-js
changelog:<changelog>Improve symbol placement performance with globe projection</changelog>