-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add workerCount option #2666
Conversation
fefd395
to
3b59858
Compare
@@ -58,7 +58,8 @@ | |||
zoom: 12.5, | |||
center: [-77.01866, 38.888], | |||
style: 'mapbox://styles/mapbox/streets-v8', | |||
hash: true | |||
hash: true, | |||
workerCount: 3 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Closes #2022
3b59858
to
198fb97
Compare
@@ -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. |
There was a problem hiding this comment.
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
Feel free to 🚢 once you've addressed my comments above! |
Looks good! |
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