-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long delay (~2s) between map style loading and vector tiles being requested #2991
Comments
Here is a video of the delay on chrome: |
As I look into this, it seems to be related to the overhead of bringing up the workers and the time spent in |
I'm experiencing the same thing, but if you look at your Network tab, you'll see the resources that come from mapbox's domain are what's delaying the load. |
@EMTurano that is not what I am seeing. There is a "gap" in network requests. Also, if this were just a max connections issue, it would affect both raster and vector tiles. However, the time seems to be spent in the worker/layer instantiation rather than any network activity. Based on my logging the network requests are not even being attempted until after the delay, whereas if it were a network bottleneck you would expect to see the tiles in the "Queueing" state for the duration of the delay. |
Can you please reproduce the issue in Chrome with the network inspector open, and then right-click of the list of network requests and "Save as HAR with Content", and post a link? Thanks! |
Certainly: I think #3153 and referenced issues describe exactly what I was seeing when I tried profiling things. @jfirebaugh think we should close this issue? |
Let's close in favor of #3153. |
mapbox-gl-js version: v0.21.0
browsers: Latest Firefox + Chrome on Mac
Steps to Trigger Behavior
Expected Behavior
Actual Behavior
Here is a screenshot of the chrome developer console (https://www.mapbox.com/mapbox-gl-js/examples/):

Interestingly this does not affect raster sources on any browser (https://www.mapbox.com/mapbox-gl-js/example/map-tiles/):

This also occurs on Firefox:

Even more interestingly, this does not happen on safari:

So, we have maps that have both vector and raster sources where the raster tiles appear seconds before their vector counterparts.
Best guess at what is happening
Purely speculation, but this seems the vector renderers (shaders? webworkers?) are being instantiated in such a way that blocks the network request for vector tiles. It seems like the vector tile requests could be triggered upon parsing the style sheet (like the glyphs and raster tiles are), so by the time the renderer is fully ready, the tiles are all available and render immediately, instead of drawing as the network requests return.
As to why this does not occur on safari?
¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered: