question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Vector] Mobile rendering is (very) slow with default cartocss and polygons

See original GitHub issue

there 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:closed
  • Created 7 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mtehvercommented, Jun 15, 2017

@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.

1reaction
mtehvercommented, Jun 14, 2017

@javisantana CartoDB/mobile-sdk

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Vector Polygons with rendering performance like ...
I am assuming by them using pixels coordinates I am guessing they are dramatically reducing the size of the data that needs to...
Read more >
Vector Tiles - qgis/QGIS-Enhancement-Proposals
Having a polygon in one vector tile, we do not know if that is the ... merging vector tiles together before rendering (off...
Read more >
Performance Testing on Vector vs. Raster Map Tiles— ...
maps are rendered. Raster tiles are currently considered as a regular solution, while the use of vector tiles is becoming more widespread.
Read more >
Performance issues in large vector layer rendering using ...
First I doubt the cause is the input format. Browsers may use hardware acceleration behind the scenes for the Canvas element, if they...
Read more >
Layers Overview - Tilezen Docs
A selection of these layers are typically used for base map rendering, and are ... Tilezen vector tiles include 9 default layers (and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found