aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-09-30 19:06:00 -0500
committerGitHub <noreply@github.com>2026-09-30 19:06:00 -0500
commit4623fd59125c7fa336784ca73c0de6605e52cb3b (patch)
tree04648f03a45ee51772d4017646c0b835ed032f1c /bin
parent65336e052d9e912ec623a60ea540ea206824ea7e (diff)
parentd11b46884919add15d89e21512e581ecec8d2d89 (diff)
downloadslskd-4623fd59125c7fa336784ca73c0de6605e52cb3b.tar.gz
Merge branch 'master' into dockerfile
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'