forked from abertschi/graalphp-parser-benchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench-parsers.sh
executable file
·40 lines (31 loc) · 949 Bytes
/
bench-parsers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
if ! command -v hyperfine &>/dev/null; then
echo "Hyperfine not found. download from https://github.com/sharkdp/hyperfine"
exit
fi
now=$(date "+%Y%m%d-%H%M%S")
script_dir="$(dirname "$(readlink -f "$0")")"
mkdir -p $script_dir/results
output="$script_dir/results/$now-parser-bench.txt"
cur_dir=$(pwd)
cd $script_dir
function execute() {
echo "benchmarking file $1" | tee -a $output
hyperfine --warmup 200 -m 2000 "php --syntax-check $1" | tee -a $output
}
base="$script_dir/src/main/resources"
f0="$base/benchmarkgame/fannkuchredux.php-1.php"
f1="$base/benchmarkgame/fasta.php-2.php"
f2="$base/phpoffice/Xls.php"
f3="$base/phpoffice/Comment.php"
f4="$base/symfony/RequestTest.php"
f5="$base/symfony/FrameworkExtension.php"
execute $f0
execute $f1
execute $f2
execute $f3
execute $f4
execute $f5
mvn package
java -jar $script_dir/target/benchmarks.jar org.graalphp.benchmark.BenchmarkParser | tee -a $output
cd $cur_dir