Skip to content

Limit parallel image requests for raster performance - #7497

Merged
mourner merged 3 commits into
masterfrom
image-queue-2
Oct 31, 2018
Merged

mourner merged 3 commits into
masterfrom
image-queue-2

Conversation

@mourner

@mourner mourner commented Oct 29, 2018

Copy link
Copy Markdown
Member

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

@asheemmamoowala asheemmamoowala left a comment

Copy link
Copy Markdown
Contributor

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
Comment thread src/util/config.js
REQUIRE_ACCESS_TOKEN: true,
ACCESS_TOKEN: null
ACCESS_TOKEN: null,
MAX_PARALLEL_IMAGE_REQUESTS: 16

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

@hyperknot

hyperknot commented Nov 28, 2018 •

Copy link
Copy Markdown

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