repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): bump typescript
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
bench.sh
diff --git
a/benchmarks/versus-external-pools/bench.sh
b/benchmarks/versus-external-pools/bench.sh
index 377a1a5bbda8fbcaea9e133d71924283964e241e..7221ba32e538c089e88636a855a7ea2681b1df76 100755
(executable)
--- a/
benchmarks/versus-external-pools/bench.sh
+++ b/
benchmarks/versus-external-pools/bench.sh
@@
-1,21
+1,23
@@
#!/usr/bin/env bash
#!/usr/bin/env bash
-### The -t argument permit to specify the type of task that you want to benchmark.
-### Supported values are CPU_INTENSIVE, IO_INTENSIVE
-### The -s argument permit to specify the size of task that you want to benchmark.
-
usage() {
usage() {
- echo "Usage: $0 [-
t <CPU_INTENSIVE|IO_INTENSIVE>] [-s
<number of tasks>]" 1>&2
+ echo "Usage: $0 [-
s <pool size> -i <number of iterations> -t <CPU_INTENSIVE|IO_INTENSIVE>] [-n
<number of tasks>]" 1>&2
exit 1
}
exit 1
}
-while getopts "
t:s
:h" option
+while getopts "
s:i:t:n
:h" option
do
case "${option}" in
do
case "${option}" in
+ s)
+ poolSize=${OPTARG}
+ ;;
+ i)
+ iterations=${OPTARG}
+ ;;
t)
taskType=${OPTARG}
;;
t)
taskType=${OPTARG}
;;
-
s
)
+
n
)
taskSize=${OPTARG}
;;
:)
taskSize=${OPTARG}
;;
:)
@@
-35,14
+37,15
@@
done
taskType=${taskType:-'CPU_INTENSIVE'}
taskSize=${taskSize:-5000}
taskType=${taskType:-'CPU_INTENSIVE'}
taskSize=${taskSize:-5000}
+poolSize=${poolSize:-$(nproc --all)}
+iterations=${iterations:-100000}
-echo 'Running benchmarks for task type:' ${taskType} 'and task size:' ${taskSize}
+echo 'Running benchmarks with pool size:' ${poolSize}', number of iterations:' ${iterations}', task type:' ${taskType} 'and task size:' ${taskSize}
+export NODE_ENV=production
export TASK_TYPE=${taskType}
export TASK_SIZE=${taskSize}
export TASK_TYPE=${taskType}
export TASK_SIZE=${taskSize}
-# Execute bench
-export NODE_ENV=production
-export POOL_SIZE=10
-export NUM_ITERATIONS=100000
+export POOL_SIZE=${poolSize}
+export NUM_ITERATIONS=${iterations}
case "$OSTYPE" in
darwin*)
caffeinate ./hyperfine_benchmarks.sh
case "$OSTYPE" in
darwin*)
caffeinate ./hyperfine_benchmarks.sh