X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.mjs;h=88868af7c43c1c3e4e5cce039f2fac71a6b99946;hb=46268b76dc942050598548d8780b07ec008dde4d;hp=3484951cfb187a42bf1af5f325cd1c436adb6baf;hpb=41e3e08eb7fbcde0a69cea17e697aacb222990a6;p=poolifier.git diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 3484951c..88868af7 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -1,13 +1,11 @@ +import { exit } from 'node:process' import { PoolTypes, WorkerTypes, availableParallelism } from '../../lib/index.mjs' -import { TaskFunctions } from '../benchmarks-types.mjs' -import { - buildPoolifierPool, - runPoolifierPoolBenchmark -} from '../benchmarks-utils.mjs' +import { TaskFunctions } from '../benchmarks-types.cjs' +import { runPoolifierPoolBenchmark } from '../benchmarks-utils.cjs' const poolSize = availableParallelism() const taskExecutions = 1 @@ -18,8 +16,10 @@ const workerData = { // FixedThreadPool await runPoolifierPoolBenchmark( - 'Poolifier FixedThreadPool', - buildPoolifierPool(WorkerTypes.thread, PoolTypes.fixed, poolSize), + 'FixedThreadPool', + WorkerTypes.thread, + PoolTypes.fixed, + poolSize, { taskExecutions, workerData @@ -28,10 +28,38 @@ await runPoolifierPoolBenchmark( // DynamicThreadPool await runPoolifierPoolBenchmark( - 'Poolifier DynamicThreadPool', - buildPoolifierPool(WorkerTypes.thread, PoolTypes.dynamic, poolSize), + 'DynamicThreadPool', + WorkerTypes.thread, + PoolTypes.dynamic, + poolSize, + { + taskExecutions, + workerData + } +) + +// FixedClusterPool +await runPoolifierPoolBenchmark( + 'FixedClusterPool', + WorkerTypes.cluster, + PoolTypes.fixed, + poolSize, { taskExecutions, workerData } ) + +// DynamicClusterPool +await runPoolifierPoolBenchmark( + 'DynamicClusterPool', + WorkerTypes.cluster, + PoolTypes.dynamic, + poolSize, + { + taskExecutions, + workerData + } +) + +exit()