-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbench.sh
executable file
·27 lines (22 loc) · 1005 Bytes
/
bench.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 -eu -o pipefail
BASE_DIR=$HOME/git
WARMUP=3
# Hint: fd is named fdfind in Debian repos (package: fd-find)
hyperfine --shell=none --warmup $WARMUP \
"find $BASE_DIR -name '.git' -type d" \
"fd --type=directory --prune --no-ignore-vcs --hidden '^\.git$' $BASE_DIR" \
"fd --type=directory --prune --no-ignore-vcs --hidden --glob '.git' $BASE_DIR" \
"project-below --base-dir $BASE_DIR --directory=.git"
hyperfine --shell=none --warmup $WARMUP \
"find $BASE_DIR -type f -name package.json" \
"fd --type=file '^package\.json$' $BASE_DIR" \
"fd --type=file --glob package.json $BASE_DIR" \
"rg --files --glob=package.json $BASE_DIR" \
"project-below --base-dir $BASE_DIR --file=package.json"
hyperfine --shell=none --warmup $WARMUP \
"find $BASE_DIR -type f -name Cargo.toml" \
"fd --type=file '^Cargo\.toml$' $BASE_DIR" \
"fd --type=file --glob Cargo.toml $BASE_DIR" \
"rg --files --glob=Cargo.toml $BASE_DIR" \
"project-below --base-dir $BASE_DIR --file=Cargo.toml"