build(ci): fix internal benchmarks freeze
[poolifier.git] / benchmarks / internal / bench.mjs
... / ...
CommitLineData
1import {
2 PoolTypes,
3 WorkerTypes,
4 availableParallelism
5} from '../../lib/index.mjs'
6import { TaskFunctions } from '../benchmarks-types.js'
7import { runPoolifierPoolBenchmark } from '../benchmarks-utils.js'
8
9const poolSize = availableParallelism()
10const taskExecutions = 1
11const workerData = {
12 function: TaskFunctions.jsonIntegerSerialization,
13 taskSize: 1000
14}
15
16// FixedThreadPool
17await runPoolifierPoolBenchmark(
18 'FixedThreadPool',
19 WorkerTypes.thread,
20 PoolTypes.fixed,
21 poolSize,
22 {
23 taskExecutions,
24 workerData
25 }
26)
27
28// DynamicThreadPool
29await runPoolifierPoolBenchmark(
30 'DynamicThreadPool',
31 WorkerTypes.thread,
32 PoolTypes.dynamic,
33 poolSize,
34 {
35 taskExecutions,
36 workerData
37 }
38)
39
40// FixedClusterPool
41await runPoolifierPoolBenchmark(
42 'FixedClusterPool',
43 WorkerTypes.cluster,
44 PoolTypes.fixed,
45 poolSize,
46 {
47 taskExecutions,
48 workerData
49 }
50)
51
52// DynamicClusterPool
53await runPoolifierPoolBenchmark(
54 'DynamicClusterPool',
55 WorkerTypes.cluster,
56 PoolTypes.dynamic,
57 poolSize,
58 {
59 taskExecutions,
60 workerData
61 }
62)