mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
* 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
41 lines
929 B
Bash
Executable File
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
|