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

Unused worker threads cause slowdown on machines with > 8 cores #7407

Closed
mollymerp opened this issue Oct 11, 2018 · 1 comment
Closed

Unused worker threads cause slowdown on machines with > 8 cores #7407

mollymerp opened this issue Oct 11, 2018 · 1 comment
Labels
needs discussion 💬 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@mollymerp
Copy link
Contributor

While investigating performance issues on a user's map load time, I noticed that we were spinning up many more workers than tiles that could be viewed on the current viewport. This user's had 32 cores, so it was spinning up 16 worker threads (WorkerPool.workerCount = Math.max(Math.floor(browser.hardwareConcurrency / 2), 1);) but only actually using ~6 of them to parse tiles, and capping the workerCount at 6 reduced page load time by ~25%

@mapbox/gl-core question for the team:
Should we be using a different metric to set our worker count (for example viewport size/tile size, or hard cap it at an arbitrary number for machines with many cores) to reduce unnecessary slowdown caused by spinning up workers?

@mollymerp mollymerp added performance ⚡ Speed, stability, CPU usage, memory usage, or power usage needs discussion 💬 labels Oct 11, 2018
@mourner
Copy link
Member

mourner commented Oct 11, 2018

I think we should simply cap the number of workers, maybe at 4? Having 16 certainly feels excessive no matter what the machine is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion 💬 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

2 participants