-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbenchmarks.sh
executable file
·69 lines (55 loc) · 1.65 KB
/
benchmarks.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
contains_arg() {
local search="$1"
shift
local found=false
for arg in "$@"; do
if [[ "$arg" == "$search" ]]; then
found=true
break
fi
done
if [[ "$found" == true ]]; then
return 0
else
return 1
fi
}
# Min testable version is 2.7.0
if [ -z "$QUTE_VERSIONS" ]; then
QUTE_VERSIONS="3.15.3 3.18.0.CR1 999-SNAPSHOT"
fi
# Set max to use Runtime.getRuntime().availableProcessors()
THREADS="1"
# Benchmarks to run
if [ "$1" ]; then
BENCHMARKS=$1
else
# JsonEscaping can only run on 3.18+
BENCHMARKS="HelloSimple|HelloParser|Loop15|Loop50|IfSimple|IfComplex|NameResolver|IncludeSimple|When|LetSimple|LetComplex|JavaBeanValueResolver|Reflect"
fi
# Profilers
ASYNC_PROFILER_PATH="/opt/java/async-profiler-3.0-linux-x64/lib/libasyncProfiler.so"
PROFILERS=""
if contains_arg "-gc" "$@"; then
PROFILERS="$PROFILERS -prof gc"
fi
if contains_arg "-flame" "$@"; then
PROFILERS="$PROFILERS -prof async:libPath=$ASYNC_PROFILER_PATH;output=flamegraph;dir=profile-results"
fi
if contains_arg "-t4" "$@"; then
THREADS="4"
fi
echo "============================================"
echo "Qute versions to test: $QUTE_VERSIONS";
echo "Benchmarks to run: $BENCHMARKS"
echo "============================================"
# Clean the target directory
mvn clean
QUTE_VERSIONS_ARRAY=$(echo $QUTE_VERSIONS);
for i in $QUTE_VERSIONS_ARRAY
do
mvn package -Dversion.qute=$i
java -jar target/qute-benchmarks.jar -t $THREADS $PROFILERS -rf json -rff target/results-$i.json $BENCHMARKS
java -cp target/qute-benchmarks.jar io.quarkus.qute.benchmark.chart.ChartGenerator target
done;