-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench
More file actions
executable file
·20 lines (20 loc) · 802 Bytes
/
bench
File metadata and controls
executable file
·20 lines (20 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
set -Eeuo pipefail
cargo build --release
{ read CPU1; read CPU2; } < <(./cores | tail -n2 | cut -d' ' -f2)
repeat() {
local count=$1
local file=$2
# NOTE: head closes the pipe after reading enough lines, which causes yes
# to exit with EPIPE; since we set -o pipefail, we need to explicitly
# ignore it
{ yes "$file" || true; } | head -n $(( $count * 64 )) | xargs taskset -c $CPU2 pv
}
echo "No-op"
repeat 100 4-unicode.txt >/dev/null
echo "Encoding ASCII"
repeat 10 1-original.txt | taskset -c $CPU1 ./target/release/ripmors -e ascii >/dev/null
echo "Encoding Unicode"
repeat 50 4-unicode.txt | taskset -c $CPU1 ./target/release/ripmors -e unicode >/dev/null
echo "Decoding"
repeat 2 2-encoded.txt | taskset -c $CPU1 ./target/release/ripmors -d >/dev/null