Skip to content
poolifierPublic

About

Poolifier benchmark versus other worker pools

Topics

Resources

Contributing

Stars

5 stars

Watchers

2 watching

Forks

Latest commit

 

History

1,081 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poolifier benchmark versus other worker pools

Table of contents

Description

To compare poolifier pools with other worker pools, we use hyperfine, which runs each pool in an isolated Node.js process so that no pool impacts another.

  • External pools with which we compare the poolifier results:

  • External pools with which we used to compare the poolifier results:

    • node-worker-threads-pool: removed because it does not support dynamic module imports or importing the task function outside the worker; the task function is expected to be self-contained, which makes it impractical to use without ugly hacks.
    • worker-threads-pool: removed because unmaintained since more than 4 years.
    • threadwork: removed because unmaintained since more than 3 years.
    • microjob: removed because unmaintained since more than 5 years.
    • threads.js: removed because not a threads pool.

⚠️ We would need funds to run our benchmark more often and on Cloud VMs, please consider to sponsor the poolifier project

Measurement modes

Each measured pool has two variants in this repository:

  • dynamic-*.mjs (or .cjs): configured with a minimum of Math.floor(poolSize / 2) and a maximum of poolSize workers. The exact floor depends on the pool's semantics — workerpool's minWorkers is a real lower-bound count, while worker-nodes treats minWorkers as an availability threshold rather than a fixed count — so the configured bounds are the reference, not an exact worker count.
  • fixed-*.mjs (or .cjs): the pool is configured with poolSize workers (no scale-down between a min and a max).

Usage

To run the benchmark, you will need to:

  • Install hyperfine
  • Clone the benchmark repository
  • Run pnpm install in the benchmark cloned repository
  • Run the ./bench.sh script
  • Run pnpm test for a quick smoke check of every measured pool (2 iterations, 2 workers and task size 10 per pool by default; NUM_ITERATIONS, POOL_SIZE, TASK_SIZE and TASK_TYPE are honored)

bench.sh honors the same environment variables. Precedence: defaults < NUM_ITERATIONS/POOL_SIZE/TASK_SIZE/TASK_TYPE (environment) < -s/-i/-t/-n (flags). POOL_SIZE is capped at 256 (auto-detected values are not capped), NUM_ITERATIONS at 10,000,000 and TASK_SIZE at 10,000; empty values are rejected, not silently defaulted.

⚠️ Please be sure to use a quiet PC when you run the benchmark

Results

CPU intensive task (default CPU_INTENSIVE mode) with 100,000 factorial(1000) operations submitted to each pool: bencher.dev.

About

Poolifier benchmark versus other worker pools

Topics

Resources

Contributing

Stars

5 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages