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

Add workerCount option #2666

Merged
merged 2 commits into from
Jun 7, 2016
Merged

Add workerCount option #2666

merged 2 commits into from
Jun 7, 2016

Conversation

anandthakker
Copy link
Contributor

Replaces #2655

Also sets workerCount on the debug page to 3, on the theory that a pretty large majority of users have 4 cpus.

Closes #2022

@@ -58,7 +58,8 @@
zoom: 12.5,
center: [-77.01866, 38.888],
style: 'mapbox://styles/mapbox/streets-v8',
hash: true
hash: true,
workerCount: 3
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need it set in the debug page — let's leave it to rely on hardwareConcurrency, which most of the browsers used by GL JS developers support. Or we could add but comment out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mourner My thinking was that, if the majority of users have 4 cores, it might actually be beneficial to have developers working under those conditions by default.

Copy link
Contributor

@lucaswoj lucaswoj Jun 3, 2016

Choose a reason for hiding this comment

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

I've been doing a little housecleaning on this debug page to keep it as simple as possible. My intent (we're not there yet) is for this page to be as simple as possible, making it an ideal place to build one-off testing rigs, and to put any persistent specialized testing rigs on other pages (i.e. video.html)

tl;dr 👍 @mourner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@anandthakker anandthakker force-pushed the worker-count-option branch from 3b59858 to 198fb97 Compare June 3, 2016 22:30
@anandthakker
Copy link
Contributor Author

@lucaswoj @mourner amended the commit to remove the change to debug/index.html

@@ -97,6 +98,7 @@ var defaultOptions = {
* @param {number} [options.zoom] The zoom level of the map's initial viewport.
* @param {number} [options.bearing] The bearing (rotation) of the map's initial viewport measured in degrees counter-clockwise from north.
* @param {number} [options.pitch] The pitch of the map's initial viewport measured in degrees.
* @param {number} [options.workerCount=navigator.hardwareConcurrency] The number of WebWorkers the map should use to process vector tile data.
Copy link
Contributor

Choose a reason for hiding this comment

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

options.workerCount=navigator.hardwareConcurrency- 1

@lucaswoj
Copy link
Contributor

lucaswoj commented Jun 3, 2016

Feel free to 🚢 once you've addressed my comments above!

@anandthakker
Copy link
Contributor Author

@lucaswoj most comments addressed, but see my note above

@lucaswoj
Copy link
Contributor

lucaswoj commented Jun 7, 2016

Looks good! :shipit:

@anandthakker anandthakker merged commit 7840d9c into master Jun 7, 2016
@anandthakker anandthakker deleted the worker-count-option branch June 7, 2016 14:31
blanchg pushed a commit to blanchg/mapbox-gl-js that referenced this pull request Jun 13, 2016
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.

3 participants