mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Add a basic venv benchmark (#853)
This commit is contained in:
parent
ee6d809b60
commit
7f6aa1a236
1 changed files with 33 additions and 0 deletions
33
scripts/benchmarks/venv.sh
Executable file
33
scripts/benchmarks/venv.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
###
|
||||
# Benchmark the virtualenv initialization against `virtualenv`.
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# ./scripts/benchmarks/venv.sh ./scripts/benchmarks/requirements.txt
|
||||
###
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
###
|
||||
# Create a virtual environment without seed packages.
|
||||
###
|
||||
hyperfine --runs 20 --warmup 3 \
|
||||
--prepare "rm -rf .venv" \
|
||||
"./target/release/puffin venv --no-cache" \
|
||||
--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.
|
||||
#
|
||||
# TODO(charlie): Support seed packages in `puffin venv`.
|
||||
###
|
||||
hyperfine --runs 20 --warmup 3 \
|
||||
--prepare "rm -rf .venv" \
|
||||
"virtualenv .venv" \
|
||||
--prepare "rm -rf .venv" \
|
||||
"python -m venv .venv"
|
Loading…
Add table
Add a link
Reference in a new issue