16ed0127ca8fac537920bc4a2905311e500fbb8c
4 echo "Usage: $0 [-s <pool size> -i <number of iterations> -t <CPU_INTENSIVE|IO_INTENSIVE>] [-n <number of tasks>]" 1>&2
8 while getopts "s:i:t:n:h" option
24 echo "Error: Missing option argument for '-${OPTARG}'" >&2;
29 echo "Error: Unknown or invalid option for '-${OPTARG}'" >&2;
38 taskType
=${taskType:-'CPU_INTENSIVE'}
39 taskSize
=${taskSize:-5000}
40 poolSize
=${poolSize:-10}
41 iterations
=${iterations:-100000}
43 echo 'Running benchmarks with pool size:' ${poolSize}', number of iterations:' ${iterations}', task type:' ${taskType} 'and task size:' ${taskSize}
45 export NODE_ENV
=production
46 export TASK_TYPE
=${taskType}
47 export TASK_SIZE
=${taskSize}
48 export POOL_SIZE
=${poolSize}
49 export NUM_ITERATIONS
=${iterations}
52 caffeinate .
/hyperfine_benchmarks.sh
55 systemd-inhibit .
/hyperfine_benchmarks.sh
58 echo "Unsupported $OSTYPE"