-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Pan/Zoom performance on Fullscreen is really bad #1000
Comments
What browser are you using? Which mapbox-gl version is installed? |
@Pessimistress it's Chrome@latest and mapbox-gl@1.6.1 |
Are you seeing the issue on this example? It is expected to be less performant in non-production mode. React's developer tools is known to impose a significant perf hit. |
I've been trying to track down some framerate issues as well and have had some interesting behavior. When I use a mapbox-gl map directly (for example, this one: https://docs.mapbox.com/mapbox-gl-js/example/add-image-animated/), the framerate is fine - but when using a react-map-gl (for example, this one: https://uber.github.io/react-map-gl/examples/interaction) the framerate is poor. The react-map-gl demo (highlighted render function is A mapbox-gl map (highlighted render function is Our app in production (highlighted render function is So to sum up, in our production app the redraw is ~50-60ms, in the react-map-gl examples it takes ~100-200ms, and mapbox-gl raw is ~3ms. This is exaggerated in my case because I run a 36 inch wide 4K monitor so it is a lot to redraw - but the difference between the two is still pretty large. I think profiling the mapbox-gl render function itself would be fruitful - maybe react-map-gl has mapbox in a state where it's doing more work than needed? react-map-gl@5.2.3 |
@contra Thanks for the insight. I wonder if this is related to the throttling of updates - mapbox-gl redraws asynchronously, while react-map-gl forces redraw on every React |
@Pessimistress Can you link the code? Not able to find it in the repo |
@contra Actually, just set |
@Pessimistress It does alleviate it, kind of:
From a production build: |
The synchronization issue is expected. I was wondering if the perf issue is caused by excessive rendering. Looks like it at least is not the only issue. What is the difference between fullscreen and non-fullscreen? Is it just caused by mapbox trying to load too much content? What is your screen resolution? |
@Pessimistress Resolution is 1440h 3440w but testing is being done with the browser resized to 1/4th of the screen, just zooming in and out on NYC. If you're curious to test it on your own system: https://nyc-ny.municipal.systems/map Certainly possible it could just be my specific GPU configuration and screen setup causing the jank. |
@contra The zoom and pan on Chromium for me on your site is fine ... I'm on a MBP16 tho with decent GPU. |
@hasanayan Do you have hardware acceleration enabled in your browser? I found the performance of panning/zooming really bad while using vector maps and having hardware acceleration disabled |
Exactly. I was very surprised when on my low spec laptop the maps were fast and on my high end pc it was super slow and choppy. Once I enabled hardware acceleration it was flying |
This is being addressed in v7.0. Please follow #1646 |
I am using react-map-gl@5.2.1. When the map is fullscreen the render is choppy when I pan or zoom. It seems the issue is related to the number of pixels to be rendered. If I open Chrome developer tools while still on fullscreen, expand its window so the map area gets narrower, it works fine.
I tried ReactMapGL on fullscreen even with the most basic setup and the issue still persists.
On the other hand, if I don't use react-map-gl and use mapbox-gl@1.6.1 fullscreen performance is flawless. Is it because react-map-gl is referencing mapbox-gl@^1.0.0 and not the latest version of it?
Is there a way to force react-map-gl to use mapbox-gl@1.6.1 ?
The text was updated successfully, but these errors were encountered: