2023-10-08 19:37:38 -04:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
|
# Benchmark the resolver against `pip-compile`.
|
|
|
|
|
#
|
|
|
|
|
# Example usage:
|
|
|
|
|
#
|
|
|
|
|
# ./scripts/benchmarks/compile.sh ./scripts/benchmarks/requirements.in
|
|
|
|
|
###
|
|
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
|
|
TARGET=${1}
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
|
# Resolution with a cold cache.
|
|
|
|
|
###
|
|
|
|
|
hyperfine --runs 20 --warmup 3 --prepare "rm -f /tmp/requirements.txt" \
|
2024-02-15 11:19:46 -06:00
|
|
|
"./target/release/uv --no-cache pip-compile ${TARGET} > /tmp/requirements.txt" \
|
2023-10-18 17:15:20 -04:00
|
|
|
"./target/release/main --no-cache pip-compile ${TARGET} > /tmp/requirements.txt"
|
2023-10-08 19:37:38 -04:00
|
|
|
|
|
|
|
|
###
|
|
|
|
|
# Resolution with a warm cache.
|
|
|
|
|
###
|
|
|
|
|
hyperfine --runs 20 --warmup 3 --prepare "rm -f /tmp/requirements.txt" \
|
2024-02-15 11:19:46 -06:00
|
|
|
"./target/release/uv pip compile ${TARGET} > /tmp/requirements.txt" \
|
2023-10-18 17:15:20 -04:00
|
|
|
"./target/release/main pip-compile ${TARGET} > /tmp/requirements.txt"
|