aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-09-30 10:02:31 -0500
committerGitHub <noreply@github.com>2026-09-30 10:02:31 -0500
commit21f0caf2fc3114d70eabe62ffdd3305ab684c365 (patch)
tree31e43c1b990670d8d251e0310d8f6fc1b1243d55 /bin
parentf950cfdb6145b7a251f3c12f3eee14b295a4b374 (diff)
parent7beef0748745aaa01b717dbde294365ec7a1dc36 (diff)
downloadslskd-21f0caf2fc3114d70eabe62ffdd3305ab684c365.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'