From f03c605bdef96d3a653f9a7fd017e045ae563997 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 9 Oct 2023 16:59:15 -0400 Subject: [PATCH] Add a script to benchmark uninstalls (#78) --- scripts/benchmarks/uninstall.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/benchmarks/uninstall.sh diff --git a/scripts/benchmarks/uninstall.sh b/scripts/benchmarks/uninstall.sh new file mode 100755 index 000000000..0788f2116 --- /dev/null +++ b/scripts/benchmarks/uninstall.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +### +# Benchmark the uninstall command against `pip`. +# +# Example usage: +# +# ./scripts/benchmarks/uninstall.sh numpy +### + +set -euxo pipefail + +TARGET=${1} + +hyperfine --runs 20 --warmup 3 --prepare "rm -rf .venv && virtualenv .venv && source activate .venv/bin/activate && pip install ${TARGET}" \ + "./target/release/puffin-cli uninstall ${TARGET}" \ + "pip uninstall -y ${TARGET}"