-
Notifications
You must be signed in to change notification settings - Fork 4
/
flamegraph.sh
27 lines (21 loc) · 1.06 KB
/
flamegraph.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
set -e
cargo build -p install-wheel-rs --bin install-wheel-rs --profile profiling --no-default-features --features cli
rm -rf test-venvs/benchmark
virtualenv -p 3.8 test-venvs/benchmark
compressed=test-data/popular-wheels/plotly-5.5.0-py2.py3-none-any.whl
stored=test-data/stored/plotly-5.5.0-py2.py3-none-any.whl
if [ ! -f "$stored" ]; then
mkdir -p test-data/stored
# https://stackoverflow.com/a/34701207/3549270
tmp_dir=$(mktemp -d)
unzip -qq "$compressed" -d "$tmp_dir"
pwd=$(pwd)
cd "$tmp_dir"
zip -q -0 -r "$pwd/$stored" ./*
cd "$pwd"
rm -r "$tmp_dir"
fi
VIRTUAL_ENV=test-venvs/benchmark flamegraph -o flamegraph_plotly.svg -- target/profiling/install-wheel-rs --skip-hashes --major 3 --minor 8 "$compressed"
VIRTUAL_ENV=test-venvs/benchmark flamegraph -o flamegraph_plotly_stored.svg -- target/profiling/install-wheel-rs --skip-hashes --major 3 --minor 8 "$stored"
VIRTUAL_ENV=test-venvs/benchmark flamegraph -o flamegraph_popular.svg -- target/profiling/install-wheel-rs --skip-hashes --major 3 --minor 8 test-data/popular-wheels/*