Files
swift-collections/Utils/run-benchmarks.sh
Karoy Lorentey 0d1ca3240c Stop depending on swift-collections-benchmark (#86)
* Stop depending on swift-collections-benchmark

Instead, move the benchmark suite into its own private nested package, under `Benchmarks/`.

The recommended way to build & run benchmarks is via the `Utils/run-benchmarks.sh` script, which continues to work as before with this change.

* Delete top-level Package.resolved file
2021-08-19 11:42:14 -07:00

41 lines
929 B
Bash
Executable File

#!/bin/sh
set -eu
srcroot="$(dirname "$0")/../Benchmarks"
results="batch.results"
command="${1:-help}"
shift || :
run() {
local flags
flags="-c release"
flags="$flags -Xswiftc -Xllvm -Xswiftc -align-module-to-page-size"
swift run --package-path "$srcroot" $flags benchmark "$@"
}
case "$command" in
batch-run)
revision="$(git rev-parse HEAD)"
run library run "$results" \
--source-url "https://github.com/apple/swift-collections/tree/$revision" \
--mode replace-all \
--max-size 4M --cycles 3 \
--amortized-cutoff 10us \
"$@"
;;
batch-render)
run library render "$results" \
--min-time 100ps --max-time 10us \
--min-size 1 --max-size 4M \
"$@"
;;
batch-clean)
rm -rf "$out"/results
;;
*)
run "$command" "$@"
;;
esac