bench/stream: script adjustments

This commit is contained in:
Qwerasd
2024-02-06 19:30:27 -05:00
parent 2db24fdd57
commit d96243fa5b

View File

@ -7,20 +7,24 @@
# Options: # Options:
# - "ascii", uniform random ASCII bytes # - "ascii", uniform random ASCII bytes
# - "utf8", uniform random unicode characters, encoded as utf8 # - "utf8", uniform random unicode characters, encoded as utf8
DATA="ascii" # - "rand", pure random data, will contain many invalid code sequences.
DATA="utf8"
SIZE="25000000" SIZE="25000000"
# Uncomment to test with an active terminal state. # Uncomment to test with an active terminal state.
#ARGS=" --terminal" # ARGS=" --terminal"
# Generate the benchmark input ahead of time so it's not included in the time. # Generate the benchmark input ahead of time so it's not included in the time.
./zig-out/bin/bench-stream --mode=gen-$DATA | head -c $SIZE > /tmp/ghostty_bench_data ./zig-out/bin/bench-stream --mode=gen-$DATA | head -c $SIZE > /tmp/ghostty_bench_data
# Uncomment to instead use the contents of `stream.txt` as input.
# yes $(cat ./stream.txt) | head -c $SIZE > /tmp/ghostty_bench_data
hyperfine \ hyperfine \
--warmup 10 \ --warmup 10 \
-n memcpy \ -n memcpy \
"cat /tmp/ghostty_bench_data | ./zig-out/bin/bench-stream --mode=noop${ARGS}" \ "./zig-out/bin/bench-stream --mode=noop${ARGS} </tmp/ghostty_bench_data" \
-n scalar \ -n scalar \
"cat /tmp/ghostty_bench_data | ./zig-out/bin/bench-stream --mode=scalar${ARGS}" \ "./zig-out/bin/bench-stream --mode=scalar${ARGS} </tmp/ghostty_bench_data" \
-n simd \ -n simd \
"cat /tmp/ghostty_bench_data | ./zig-out/bin/bench-stream --mode=simd${ARGS}" "./zig-out/bin/bench-stream --mode=simd${ARGS} </tmp/ghostty_bench_data"