Skip to content
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

Limit parallel image requests for raster performance #7497

Merged
merged 3 commits into from
Oct 31, 2018
Merged

Conversation

mourner
Copy link
Member

@mourner mourner commented Oct 29, 2018

Fixes #7460, improving raster sources performance on big screens by setting a global limit on how many image requests can happen in parallel, and queueing all the rest.

Similarly to workerCount, the PR exposes the limit as mapboxgl.maxParallelImageRequests which you can change (16 by default).

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs (probably not worth publicly documenting?)
  • post benchmark scores benchmarks don't exercise big-screen tile loading
  • manually test the debug page

@mourner mourner requested a review from kkaefer October 29, 2018 13:26
Copy link
Contributor

@asheemmamoowala asheemmamoowala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mourner mourner merged commit 999a8d9 into master Oct 31, 2018
@mourner mourner deleted the image-queue-2 branch October 31, 2018 15:47
asheemmamoowala pushed a commit that referenced this pull request Oct 31, 2018
* limit parallel image requests for raster performance

* add a test for maxParallelImageRequests

* fix flow
@@ -17,7 +18,8 @@ const config: Config = {
}
},
REQUIRE_ACCESS_TOKEN: true,
ACCESS_TOKEN: null
ACCESS_TOKEN: null,
MAX_PARALLEL_IMAGE_REQUESTS: 16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why default to 16?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to pick a number anyway, and that's what OpenLayers defaults to — it seemed to work well in practice, so I left it at that. We can adjust the default if you think 16 isn't a good value.

@hyperknot
Copy link

So this one is a properly implemented cbb059f? And you are saying that the XHR overhead shouldn't make a difference after this?

@hyperknot
Copy link

hyperknot commented Nov 28, 2018

Ah, so this actually shipped with 0.51 but was missed out from the Changelog?
I was checking the changelog and I didn't see anything related to rasters! So this is great, actually it's the biggest performance update for raster layers in a very long time! Congrats!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants