Suppose you have a task on your webapp that demands maximum performance. The task is highly parallelizable: you can subdivide it on, say, 500 independent subtasks. What is the best solution?
- (A) Merely spawn 500 Web Workers.
- (B) Spawn a small amount t of Web Workers and make them consume those 500 tasks.
If (B) is the way to go, how can you determine (empirically if needed) the best value for t? Is there any library to solve this particular problem?