uv/scripts/benchmarks/venv.sh
Zanie Blue 2586f655bb
Rename to uv (#1302)
First, replace all usages in files in-place. I used my editor for this.
If someone wants to add a one-liner that'd be fun.

Then, update directory and file names:

```
# Run twice for nested directories
find . -type d -print0 | xargs -0 rename s/puffin/uv/g
find . -type d -print0 | xargs -0 rename s/puffin/uv/g

# Update files
find . -type f -print0 | xargs -0 rename s/puffin/uv/g
```

Then add all the files again

```
# Add all the files again
git add crates
git add python/uv

# This one needs a force-add
git add -f crates/uv-trampoline
```
2024-02-15 11:19:46 -06:00

33 lines
747 B
Bash
Executable file

#!/usr/bin/env bash
###
# Benchmark the virtualenv initialization against `virtualenv`.
#
# Example usage:
#
# ./scripts/benchmarks/venv.sh
###
set -euxo pipefail
###
# Create a virtual environment without seed packages.
###
hyperfine --runs 20 --warmup 3 \
--prepare "rm -rf .venv" \
"./target/release/uv venv" \
--prepare "rm -rf .venv" \
"virtualenv --without-pip .venv" \
--prepare "rm -rf .venv" \
"python -m venv --without-pip .venv"
###
# Create a virtual environment with seed packages.
###
hyperfine --runs 20 --warmup 3 \
--prepare "rm -rf .venv" \
"./target/release/uv venv --seed" \
--prepare "rm -rf .venv" \
"virtualenv .venv" \
--prepare "rm -rf .venv" \
"python -m venv .venv"