Files
swift-collections/Utils/run-benchmarks.sh
T
Karoy Lorentey a2bcac435f Initial import.
Introduce OrderedCollections module
2021-04-05 09:41:00 -07:00

41 lines
936 B
Bash
Executable File

#!/bin/sh
set -eu
srcroot="$(dirname "$0")/.."
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 swift-collections-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