Apply dependencies update
[poolifier.git] / benchmarks / versus-external-pools / bench.sh
CommitLineData
bd0e5c4d
JB
1#!/usr/bin/env bash
2
7a6a0a96
JB
3### The -t argument permit to specify the type of task that you want to benchmark.
4### The -s argument permit to specify the size of task that you want to benchmark.
5### Supported values are CPU_INTENSIVE, IO_INTENSIVE
be0676b3 6
9f7e7a99 7taskType='CPU_INTENSIVE'
7a6a0a96
JB
8taskSize=5000
9while getopts "t:s:h" option
9f7e7a99 10do
7a6a0a96 11 case "${option}" in
bd0e5c4d
JB
12 t)
13 taskType=${OPTARG}
14 ;;
7a6a0a96
JB
15 s)
16 taskSize=${OPTARG}
17 ;;
18 *|h)
19 echo "Usage: $0 [-t taskType] [-s taskSize]"
20 exit 1
21 ;;
bd0e5c4d 22 esac
9f7e7a99 23done
be0676b3 24
7a6a0a96
JB
25echo 'Running benchmarks for task type:' ${taskType} 'and task size:' ${taskSize}
26export TASK_TYPE=${taskType}
27export TASK_SIZE=${taskSize}
9f7e7a99 28# Execute bench
29export NODE_ENV=production
be0676b3
APA
30export POOL_SIZE=10
31export NUM_ITERATIONS=100000
bd0e5c4d
JB
32case "$OSTYPE" in
33 darwin*)
34 caffeinate ./hyperfine_benchmarks.sh
35 ;;
36 linux*)
37 systemd-inhibit ./hyperfine_benchmarks.sh
38 ;;
39 *)
40 echo "Unsupported $OSTYPE"
41 ;;
42esac