Commit | Line | Data |
---|---|---|
bd0e5c4d JB |
1 | #!/usr/bin/env bash |
2 | ||
9f7e7a99 | 3 | ### The -t argument is needed to specify the type of task that you want to benchmark. |
4 | ### Supported values are CPU_INTENSIVE | |
be0676b3 | 5 | |
9f7e7a99 | 6 | taskType='CPU_INTENSIVE' |
7 | while getopts t: flag | |
8 | do | |
bd0e5c4d JB |
9 | case "${flag}" in |
10 | t) | |
11 | taskType=${OPTARG} | |
12 | ;; | |
13 | esac | |
9f7e7a99 | 14 | done |
be0676b3 | 15 | |
9f7e7a99 | 16 | echo 'Running bench for task type:' $taskType |
17 | export TASK_TYPE=$taskType | |
18 | # Execute bench | |
19 | export NODE_ENV=production | |
be0676b3 APA |
20 | export POOL_SIZE=10 |
21 | export NUM_ITERATIONS=100000 | |
bd0e5c4d JB |
22 | case "$OSTYPE" in |
23 | darwin*) | |
24 | caffeinate ./hyperfine_benchmarks.sh | |
25 | ;; | |
26 | linux*) | |
27 | systemd-inhibit ./hyperfine_benchmarks.sh | |
28 | ;; | |
29 | *) | |
30 | echo "Unsupported $OSTYPE" | |
31 | ;; | |
32 | esac |