- [piscina](https://github.com/piscinajs/piscina)
- [tinypool](https://github.com/tinylibs/tinypool)
-- [node-worker-threads-pool](https://github.com/SUCHMOKUO/node-worker-threads-pool)
+- [node-worker-threads-pool](https://github.com/SUCHMOKUO/node-worker-threads-pool): removed from the benchmark because does not support ESM modules
- [workerpool](https://github.com/josdejong/workerpool)
- [worker-nodes](https://github.com/allegro/node-worker-nodes)
- [threads.js](https://github.com/andywer/threads.js/)
+import crypto from 'crypto'
+import fs from 'fs'
+
/**
* The worker function to execute during pools benchmarks.
* NOTE: This function requires to be self-contained, thread-safe and re-entrant.
* @returns {*} The result.
*/
export default async function functionToBench (data) {
- const { default: crypto } = await import('crypto')
- const { default: fs } = await import('fs')
const TaskTypes = {
CPU_INTENSIVE: 'CPU_INTENSIVE',
IO_INTENSIVE: 'IO_INTENSIVE'
'node dynamic-tinypool.mjs' \
'node dynamic-workerpool.mjs' \
'node fixed-workerpool.mjs' \
- 'node dynamic-node-worker-threads-pool.mjs' \
- 'node static-node-worker-threads-pool.mjs' \
'node dynamic-worker-nodes.mjs' \
'node fixed-worker-nodes.mjs' \
'node threadjs.mjs' \