Comments (1)
You roughly have the following: say you have 36 tasks that take 10 seconds each.
- If you execute them in 1 process, it will take roughly 360 seconds. The first task returns after 10 sec, the last after in 360 sec.
- If you execute them in 6 processes, it will take roughly 60 seconds. The first task returns after 10 sec, the last after in 60 sec.
- If you execute them in 36 processes, it will take roughly 60 seconds. All tasks return after 60 seconds. Each task is 6 times slower than it could have been, because it is sharing the same CPU core with 5 other tasks simultaneously. This can be interesting if you have a mix of long and short tasks: if there are enough processes available, short tasks will not be blocked in a queue when some large task is running.
There is one important caveat here: if you spin up more processes, you'll have to make sure that you have enough memory for all of them.
from workerpool.
Related Issues (20)
- support worker execArgv HOT 2
- Fix the code coverage script HOT 1
- App bundle fails to start worker, with message : "Worker is terminated" HOT 1
- Type of error is not kept when error goes from inside to outside the workerpool HOT 1
- Uncaught SyntaxError: Unexpected token '<' (at worker.ts:1:1) HOT 1
- Send event / message to running Worker? HOT 11
- Concurrent async tasks on a single worker HOT 1
- MaxListenersExceededWarning with worker_threads in node.js HOT 5
- Unsafe-eval violation HOT 2
- Main node process crashes with OOM error HOT 3
- How to use with typescript HOT 2
- Error: TimeoutError: Promise timed out after 600000 milliseconds HOT 4
- Update type definitions with the new 'Transfer' options HOT 3
- Send message to persistent worker's stdin HOT 7
- Cannot use import statement outside a module (in Vite) HOT 15
- Possible bugs in the code. HOT 3
- child_process.spawn() or child_process.exec() HOT 1
- TypeError: process.send is not a function HOT 4
- (question) How to override the .exec function ? HOT 2
- How to use TypeORM or Prisma inside worker ? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workerpool.