Thin out repeated line labels at overscaled tiles #11414
Merged
+16
−1
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.
Prior to this change, the repeated line labels (such as street names) were placed too densely on overscaled tiles, sometimes even closer than the value of the
symbol-spacing
property.This caused a noticeable increase in memory usage, and the memory use increased dramatically with higher tiles overscale factors.
This change partially mitigates the issue with the following changes:
symbol-spacing
style property value (tile pixel ratio is clamped to 1)For example for

http://localhost:9966/debug#22/40.79230555/-73.9733581/33.4/67
:memory usage before:
memory usage after:

So overall memory usage decreased from 75 MB to 26 MB, the amount of allocated objects decreased from 55694 to 21228
Launch Checklist
mapbox-gl-js
changelog:<changelog>Thin out repeated line labels at overscaled tiles in order to decrease memory and CPU usage</changelog>