X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.mjs;h=adff36153241f7843f702547237280a509bb7326;hb=10fdf6b15d99197b3e9a783dcc697f1acaf02cd2;hp=3484951cfb187a42bf1af5f325cd1c436adb6baf;hpb=cde5b54ed8ffa2a288b697c3ab921a6cf7231694;p=poolifier.git diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 3484951c..adff3615 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -3,11 +3,8 @@ import { WorkerTypes, availableParallelism } from '../../lib/index.mjs' -import { TaskFunctions } from '../benchmarks-types.mjs' -import { - buildPoolifierPool, - runPoolifierPoolBenchmark -} from '../benchmarks-utils.mjs' +import { TaskFunctions } from '../benchmarks-types.js' +import { runPoolifierPoolBenchmark } from '../benchmarks-utils.js' const poolSize = availableParallelism() const taskExecutions = 1 @@ -18,8 +15,10 @@ const workerData = { // FixedThreadPool await runPoolifierPoolBenchmark( - 'Poolifier FixedThreadPool', - buildPoolifierPool(WorkerTypes.thread, PoolTypes.fixed, poolSize), + 'FixedThreadPool', + WorkerTypes.thread, + PoolTypes.fixed, + poolSize, { taskExecutions, workerData @@ -28,8 +27,34 @@ 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