Skip to content

Initial page load is still slow compared to original GH maps #132

Closed

Description

@easbar

@boldtrn suggested the following:

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?

Activity

  1. boldtrn commented on Sep 29, 2021

    @boldtrn
    Member
  2. added this to the 0.4 milestone on Nov 3, 2021
  3. easbar commented on Nov 3, 2021

    @easbar
    MemberAuthor
  4. karussell commented on Nov 3, 2021

    @karussell
    Member

    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.

  5. boldtrn commented on Nov 3, 2021

    @boldtrn
    Member

    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.

  6. easbar commented on Nov 10, 2021

    @easbar
    MemberAuthor

    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/

  7. karussell commented on Nov 11, 2021

    @karussell
    Member

    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.

  8. easbar commented on Nov 11, 2021

    @easbar
    MemberAuthor

    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.

    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:

    /ol_exp/bundle.js(gh-maps-react.s3-website.eu-central-1.amazonaws.com) | 5,750.1 KiB
    /ol_exp_no_vector_tiles/bundle.js(gh-maps-react.s3-website.eu-central-1.amazonaws.com) | 4,775.5 KiB
    /master/bundle.js(gh-maps-react.s3-website.eu-central-1.amazonaws.com) | 3,342.3 KiB
    /maps2/bundle.js(graphhopper.com) | 368.0 KiB
    

    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.

  9. karussell commented on Nov 11, 2021

    @karussell
    Member

    So the hosted version is much smaller, and the unzipped OL version is much bigger than the unzipped master version

    Ah, nice, so even more surprising that it is the fastest :) !

    Can you add the api key for omniscale so we can test this too?

    Sure. But omniscale works only on graphhopper.com.

  10. easbar commented on Nov 18, 2021

    @easbar
    MemberAuthor

    Possibly related:

    visgl/react-map-gl#1529
    visgl/react-map-gl#1151
    visgl/react-map-gl#1000

    Trying asyncRender={true} could be worthwhile.

  11. karussell commented on Nov 18, 2021

    @karussell
    Member

    Trying asyncRender={true} could be worthwhile.

    For my test I did a few months ago with the navi branch this did not help.

  12. easbar commented on Jan 26, 2022

    @easbar
    MemberAuthor

    I think this is fixed with #159

  13. deleted a comment from hy31337 on Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions