Repository navigation
Conversation
|
Would be great to get some feedback on how this PR performs on Android and iOS. |
|
Sorry for the delay here @tmpsantos — iOS release-focused. This seems clean enough and I will give it a spin. If I'm understanding it properly, this would obsolete the need for /cc @adam-mapbox |
|
@incanus I don't believe this would eliminate the need for |
|
My point is that |
We could throttle
What this patch is doing is throttling the So what this patch as it is really does is save CPU and decrease latency when rendering because right now we render on the |
|
Ahhhh, awesome. So testing here for mobile would mostly involve just making sure perf looks good and no regressions are introduced, but nothing super concrete other than hopeful reduced CPU usage. |
6ce0429 to
fde8c07
Compare
And increase the number of requests that are going to be merged together.
Throttle how often we update the tile state. Previously we were updating as fast as we could, but if we do it more often than the frame rate, it is just a waste of resources because you only see the last state before rendering a frame. Note that we still send invalidate requests as much as we can. In my tests throttling the ::invalidate() rate to the same frequency as the ::update() didn't yield great results mostly because the clock tick is not so precise. Maybe it could be tunned so we don't spam the client with invalidate request and don't wake the main loop too much. Finally, we should probably expose the update throttle as a public API because: 1. The client might want to reduce the update frequency due to performance reasons. I.e. wants to paint at 60FPS at the cost of not having a so up-to-date map in the frame. 2. The client might have a frame rate set to something lower than 60FPS so updating at 16ms is overkill.
fde8c07 to
2cdb0ff
Compare
|
Closing; stale. I'd like to see an approach where we replace the "update" async task with a view invalidation whenever required, and perform the necessary updates inline in the render pathway. Throttling then can be the job of the view implementation. This is the approach that mapbox-gl-js uses. |
Throttle how often we update the tile state. Previously we were updating as fast as we could, but if we do it more often than the frame rate, it is just a waste of resources because you only see the last state before rendering a frame.
Note that we still send invalidate requests as much as we can. In my tests throttling the ::invalidate() rate to the same frequency as the ::update() didn't yield great results mostly because the clock tick is not so precise. Maybe it could be tunned so we don't spam the client with invalidate request and don't wake the main loop too much.
Finally, we should probably expose the update throttle as a public API because: