TANGRAM VERSION:
Tangram v0.21.1
ENVIRONMENT:
macOS Big Sur running either Firefox 83 or Chrome 87.
TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:
- Load the following Tangram scene (paste into play.tangram.city, for example; sorry I had to zip it as GitHub rejects yaml files): scene.yaml.zip
- Zoom to the Baltic Sea area at z6/z7 (Tangram calls it z7, but MVTs are sort of off-by-one and double the standard slippy tile size so the loaded tiles will be z6).
RESULT:
It will take approximately 30 seconds to fully render the tiles containing the coastline of Sweden and the Åland Islands on a loaded 16" MBP.
EXPECTED RESULT:
It will render the tiles in a reasonable period of time ;)
I'm sure that the detail level of our tiles bears some of the blame, but comparable renderers such as Mapbox/MapLibre GL JS and OpenLayers (using the https://github.com/openlayers/ol-mapbox-style plugin) have no issues rendering this area so I think we've hit some sort of edge case/inefficiency in the geometry functions.
I initially thought this was due to the rather obscene number of town+village labels in Latvia (large numbers of labels in places like Latvia and Germany ARE extremely slow, but that's not the main point of this ticket and we can probably mitigate that by thinning our tiles), but profiling it in Chrome revealed that most of the time was actually spent in intersectsPolygon. I am pretty sure the water layer is mostly to blame, as disabling wide ranges of other layers (including all label layers) has no noticeable effect. However, removing only the water layer from the scene allows it to render very quickly.

I'm still familiarizing myself with the code, but if this is something I can help with, I'd be happy to give it a shot if you can point me in the right direction.
TANGRAM VERSION:
Tangram v0.21.1
ENVIRONMENT:
macOS Big Sur running either Firefox 83 or Chrome 87.
TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:
RESULT:
It will take approximately 30 seconds to fully render the tiles containing the coastline of Sweden and the Åland Islands on a loaded 16" MBP.
EXPECTED RESULT:
It will render the tiles in a reasonable period of time ;)
I'm sure that the detail level of our tiles bears some of the blame, but comparable renderers such as Mapbox/MapLibre GL JS and OpenLayers (using the https://github.com/openlayers/ol-mapbox-style plugin) have no issues rendering this area so I think we've hit some sort of edge case/inefficiency in the geometry functions.
I initially thought this was due to the rather obscene number of town+village labels in Latvia (large numbers of labels in places like Latvia and Germany ARE extremely slow, but that's not the main point of this ticket and we can probably mitigate that by thinning our tiles), but profiling it in Chrome revealed that most of the time was actually spent in
intersectsPolygon. I am pretty sure the water layer is mostly to blame, as disabling wide ranges of other layers (including all label layers) has no noticeable effect. However, removing only the water layer from the scene allows it to render very quickly.I'm still familiarizing myself with the code, but if this is something I can help with, I'd be happy to give it a shot if you can point me in the right direction.