X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Fbench.sh;h=f78500f773032e33411ffdf820d1e3e582cc902c;hb=6fbe9c2f32c76371b86566af08e04c0056035626;hp=b6c339f84a1f3b408aaa4b30349b3f745cf26acf;hpb=74750c7f0a8b83b3a579f4d7fc96070ca540b234;p=poolifier.git diff --git a/benchmarks/versus-external-pools/bench.sh b/benchmarks/versus-external-pools/bench.sh index b6c339f8..f78500f7 100755 --- a/benchmarks/versus-external-pools/bench.sh +++ b/benchmarks/versus-external-pools/bench.sh @@ -1,12 +1,16 @@ +#!/usr/bin/env bash + ### The -t argument is needed to specify the type of task that you want to benchmark. ### Supported values are CPU_INTENSIVE taskType='CPU_INTENSIVE' while getopts t: flag do - case "${flag}" in - t) taskType=${OPTARG};; - esac + case "${flag}" in + t) + taskType=${OPTARG} + ;; + esac done echo 'Running bench for task type:' $taskType @@ -15,12 +19,14 @@ export TASK_TYPE=$taskType export NODE_ENV=production export POOL_SIZE=10 export NUM_ITERATIONS=100000 -hyperfine --export-markdown BENCH-100000.md --min-runs 10 \ - --prepare 'sleep 15' \ - 'node dynamic-piscina.js' \ - 'node fixed-piscina.js' \ - 'node dynamic-poolifier.js' \ - 'node fixed-poolifier.js' \ - 'node static-suchmokuo-node-worker-threads-pool.js' \ - 'node dynamic-suchmokuo-node-worker-threads-pool.js' \ - 'node threadjs.js' +case "$OSTYPE" in + darwin*) + caffeinate ./hyperfine_benchmarks.sh + ;; + linux*) + systemd-inhibit ./hyperfine_benchmarks.sh + ;; + *) + echo "Unsupported $OSTYPE" + ;; +esac