-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
run-benchmarks.sh
59 lines (49 loc) · 1.47 KB
/
run-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
#!/bin/bash
#
## Helper for running Benchmarks.
#------------------------------------------------------------------------------
set -e
#------------------------------------------------------------------------------
if [[ "$1" == "--install-sdk" ]]; then
echo "installing SDK $SDK_VERSION"
echo ""
curl -o dotnet-install.sh https://dot.net/v1/dotnet-install.sh
mkdir dotnet
chmod u+x ./dotnet-install.sh
./dotnet-install.sh --install-dir $(pwd)/dotnet -v $SDK_VERSION
rm $(pwd)/dotnet-install.sh
export PATH="$(pwd)/dotnet:$PATH"
echo ""
fi
tfm=${BENCH_FX:-net7.0}
echo ""
echo "Running benchmarks with tfm: $tfm"
echo "-------------------------------------------------"
if [[ "$tfm" == "net7.0" ]]; then
echo "installed sdks:"
dotnet --list-sdks
echo "-------------------------------------------------"
fi
cd perf/gfoidl.Base64.Benchmarks
dotnet build -c Release -f "$tfm"
cd bin/Release/$tfm
exe=gfoidl.Base64.Benchmarks
cmd=
if [[ -f "$exe" || -f "$exe".exe ]]; then
cmd="./$exe"
echo "using exe"
else
cmd="dotnet ./$exe.dll"
echo "using dotnet command"
fi
$cmd --list tree
$cmd -f *Base64EncoderBenchmark*
$cmd -f *Base64UrlEncoderBenchmark*
$cmd -f *DecodeStringBenchmark*
$cmd -f *DecodeStringUrlBenchmark*
$cmd -f *DecodeUtf8Benchmark*
$cmd -f *EncodeStringBenchmark*
$cmd -f *EncodeStringUrlBenchmark*
$cmd -f *EncodeUtf8Benchmark*
$cmd -f *ReadOnlySequenceBase64Benchmark*
$cmd -f *ReadOnlySequenceBase64UrlBenchmark*