You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Initial page load is still slow compared to original GH maps #132
why are two icons loaded: /assets/favicon-16x16.png and /assets/apple-touch-icon-1024x1024.png
initially maptiler does 3 requests to fonts (3*43kb) - can we reduce to 1 request? > we use raster tiles by default since Migrate from Mapbox to OpenLayers #159
and I think we already figured that maptiler vector tiles are slow compared to mapbox, even on their website. However, this should not affect the page load when we use raster tiles?
When comparing PageSpeed for old vs. new then it seems we should also look how we can reduce the work for the main thread (2.7s vs. 0.1s) and "Total Blocking time" (0.8s vs. 0). Correlated to the task to profile this app in chrome, I think.
IMHO, the biggest thing to consider here is that you can't compare Leaflet to a vector tile library. Vector tiles move the actual render work to the client side, which increases the work the browser has do and also increases the page size. So I am not sure if this is something that could be fixed at all.
You can experiment with Tree Shaking etc., but I am not sure this will solve the underlying issue, just improve it.
After some discussions with @karussell OpenLayers is still an option. Here I replaced Mapbox with OpenLayers (just the background layer (only OSM so far), no markers, paths etc. yet):
Wow, this is nicely fast :D. We could e.g. keep using Omniscale as our default and still switch to vector tiles for MVT (or my navi experiment).
IMHO, the biggest thing to consider here is that you can't compare Leaflet to a vector tile library.
The raster tiles are also slower when using mapbox/maplibre. And for the perceived slowness not only the time it takes is slower but also the responsiveness is worse (lower measureable FPS). I compared an uncached refresh (network tab -> disable cache + enabled "recording performance"):
openlayers raster: 1-3s and average FPS is ~45
master raster: 3.5-4.5s and average FPS is ~25
master vector: 5-7s and average FPS is ~25
The Openlayers demo currently has the minor advantage of http vs https. But still you can see that openlayers is less demanding. And with the "performance" tool in FF I also see that a FPS drop in case of the vector tiles remain a bit even after everything is updated.
You can experiment with Tree Shaking etc., but I am not sure this will solve the underlying issue, just improve it.
I don't think this is DOM or react related. Probably more canvas vs. web GL (and also ff vs. chrome). E.g. I also tested with a desktop PC (with a better GPU than my laptop?) and chrome, then this difference was much smaller.
I just updated this branch to include the other raster tiles (even the ones that did not work with Mapbox, lyrk&wanderreitkarte), and I enabled vector tiles as well.
Can you add the api key for omniscale so we can test this too?
The Openlayers demo currently has the minor advantage of http vs https.
So the hosted version is much smaller, and the unzipped OL version is much bigger than the unzipped master version. ol_exp_no_vector_tiles does not use vector tiles at all so the bundle size is also a bit smaller.
Activity
boldtrn commentedon Sep 29, 2021
As a side-note, if you look at the library size of leaflet vs. maplibre, it is significantly larger (contains all the code to render vector tiles :)).
https://bundlephobia.com/package/[email protected]
https://bundlephobia.com/package/[email protected]
easbar commentedon Nov 3, 2021
Maybe it is worth looking at these experiments I did a while back again: https://github.com/easbar/gh_maps_experiments
karussell commentedon Nov 3, 2021
When comparing PageSpeed for old vs. new then it seems we should also look how we can reduce the work for the main thread (2.7s vs. 0.1s) and "Total Blocking time" (0.8s vs. 0). Correlated to the task to profile this app in chrome, I think.
boldtrn commentedon Nov 3, 2021
IMHO, the biggest thing to consider here is that you can't compare Leaflet to a vector tile library. Vector tiles move the actual render work to the client side, which increases the work the browser has do and also increases the page size. So I am not sure if this is something that could be fixed at all.
You can experiment with Tree Shaking etc., but I am not sure this will solve the underlying issue, just improve it.
easbar commentedon Nov 10, 2021
After some discussions with @karussell OpenLayers is still an option. Here I replaced Mapbox with OpenLayers (just the background layer (only OSM so far), no markers, paths etc. yet):
http://gh-maps-react.s3-website.eu-central-1.amazonaws.com/ol_exp/
karussell commentedon Nov 11, 2021
Wow, this is nicely fast :D. We could e.g. keep using Omniscale as our default and still switch to vector tiles for MVT (or my navi experiment).
The raster tiles are also slower when using mapbox/maplibre. And for the perceived slowness not only the time it takes is slower but also the responsiveness is worse (lower measureable FPS). I compared an uncached refresh (network tab -> disable cache + enabled "recording performance"):
The Openlayers demo currently has the minor advantage of http vs https. But still you can see that openlayers is less demanding. And with the "performance" tool in FF I also see that a FPS drop in case of the vector tiles remain a bit even after everything is updated.
I don't think this is DOM or react related. Probably more canvas vs. web GL (and also ff vs. chrome). E.g. I also tested with a desktop PC (with a better GPU than my laptop?) and chrome, then this difference was much smaller.
easbar commentedon Nov 11, 2021
I just updated this branch to include the other raster tiles (even the ones that did not work with Mapbox, lyrk&wanderreitkarte), and I enabled vector tiles as well.
Can you add the api key for omniscale so we can test this too?
But there should not be any difference in this regard if you compare
http://gh-maps-react.s3-website.eu-central-1.amazonaws.com/ol_exp/ vs
http://gh-maps-react.s3-website.eu-central-1.amazonaws.com/master/
?
Compared to graphhopper.com/maps2 the aws deployment also does not use zip etc.? I just checked pagespeed and got the following:
So the hosted version is much smaller, and the unzipped OL version is much bigger than the unzipped master version.
ol_exp_no_vector_tilesdoes not use vector tiles at all so the bundle size is also a bit smaller.karussell commentedon Nov 11, 2021
Ah, nice, so even more surprising that it is the fastest :) !
Sure. But omniscale works only on graphhopper.com.
easbar commentedon Nov 18, 2021
Possibly related:
visgl/react-map-gl#1529
visgl/react-map-gl#1151
visgl/react-map-gl#1000
Trying
asyncRender={true}could be worthwhile.karussell commentedon Nov 18, 2021
For my test I did a few months ago with the navi branch this did not help.
easbar commentedon Jan 26, 2022
I think this is fixed with #159