aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-09-13 19:34:57 -0500
committerJP Dillingham <jp@dillingham.me>2026-09-13 19:34:57 -0500
commitf857fa37a94bac0967f31d56b839e699b39db427 (patch)
treea5519ed4082fed48ee64300effbe1f5d51fd31d1 /bin
parent5699bcf9fde961105b917350b720803c869566f2 (diff)
parent92167f6f1657703959d6ea94e4af82169c5c5fba (diff)
downloadslskd-f857fa37a94bac0967f31d56b839e699b39db427.tar.gz
Merge remote-tracking branch 'origin/master' into enumerate
Diffstat (limited to 'bin')
-rwxr-xr-xbin/benchmark39
1 files changed, 39 insertions, 0 deletions
diff --git a/bin/benchmark b/bin/benchmark
new file mode 100755
index 00000000..33e11f33
--- /dev/null
+++ b/bin/benchmark
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+set -e
+set -o pipefail
+
+test_name=""
+
+while test $# -gt 0; do
+ case "$1" in
+ -h|--help)
+ echo ''
+ echo 'usage: benchmark --test <name>'
+ echo ''
+ echo 'options:'
+ echo '-h, --help show help'
+ echo '--test NAME name (or substring, case-insensitive) of the benchmark test class to run'
+ echo ''
+ echo 'examples:'
+ echo ' benchmark --test helloworld'
+ echo ''
+ exit 0
+ ;;
+ --test)
+ shift
+ test_name=$1
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+if [ -z "$test_name" ]; then
+ echo 'error: --test is required'
+ exit 1
+fi
+
+dotnet test tests/slskd.Tests.Benchmarks -c Release -v q --nologo --filter "FullyQualifiedName~$test_name" --logger "console;verbosity=detailed" \
+ | sed -n '/BenchmarkRunner: Start/,/BenchmarkRunner: End/p'