[Vector] Mobile rendering is (very) slow with default cartocss and polygons
See original GitHub issuethere is big performance difference in opengl whether polygon outline is drawn for each polygon (e.g. building) separately, or all outlines are rendered last after all polygons. The second is 10+ times faster. Example slow:
#buildings {
polygon-opacity: 0.7;
line-color: #FFF;
line-width: 0.5;
line-opacity: 1;
}
and fast:
#buildings {
polygon-opacity: 0.7;
::outline{
line-color: #FFF;
line-width: 0.5;
line-opacity: 1;
}
}
For base maps we always rewrite css as fast option, otherwise it is visibly slow. CartoDB editor supports both options, but only if you manually change it. When you use Wizard (e.g. “Simple”) or just use default style it creates the slower option. Suggestion is to change default cartocss styling for outlines. The result semantic is not really the same, maybe for some maps you do not want to draw outlines at once for all objects, but then user can always change this. This would help basically all mobile maps where polygons with outlines are used.
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (8 by maintainers)
Top GitHub Comments
@donflopez Yes, that is pretty much it. The commit I mentioned generalizes line shader so that it is capable of rendering polygons also. So if the lower level of the rendering stack has already seen a line and gets a polygon next, it will not flush the existing line batch and sets up polygon vertex data so that it can be renderered as part of the existing batch using line shader.
@javisantana CartoDB/mobile-sdk