bench: microsecond timing via tools/timeit, toybox oracle, words to 10M lines
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# bench.sh — race fastwc against GNU coreutils wc on line counts, file input.
|
||||
# Busybox wc is raced too, for shits and giggles. Includes the monster
|
||||
# cases: 100M lines raced against coreutils (busybox through 1.1 GB is a
|
||||
# spectator sport, not a benchmark), and 1B lines timed solo (no
|
||||
# reference to beat — there isn't one).
|
||||
# Busybox and toybox wc are raced too, for shits and giggles. Includes
|
||||
# the monster cases: 100M lines raced against coreutils (busybox/toybox
|
||||
# through 1.1 GB is a spectator sport, not a benchmark), and 1B lines
|
||||
# timed solo (no reference to beat — there isn't one).
|
||||
# Fails fast: the moment fastwc is slower than (or disagrees with) an
|
||||
# oracle wc, a human readable report is written to FAILED-benchmark.txt
|
||||
# and this script exits non-zero.
|
||||
@@ -23,7 +23,7 @@ for oracle in $ORACLES; do
|
||||
|
||||
printf 'benchmarking %s wc vs fastwc: lines, file input (%s interleaved runs each, minimum kept)\n' \
|
||||
"$BENCH_NAME" "$BENCH_REPS"
|
||||
printf '%-28s %10s %22s %8s %s\n' 'test' 'wc' 'fastwc (ms µs)' 'ratio' 'status'
|
||||
printf '%-28s %16s %24s %8s %s\n' 'test' 'wc' 'fastwc (µs)' 'ratio' 'status'
|
||||
|
||||
printf '%s\n' '--- lines ---'
|
||||
if ! run_cases lines -l 10000 100000 1000000 10000000; then
|
||||
@@ -34,8 +34,9 @@ for oracle in $ORACLES; do
|
||||
"$BENCH_NAME" "$BENCH_NAME"
|
||||
done
|
||||
|
||||
# The monsters stay coreutils-only (busybox through 1.1 GB is a spectator
|
||||
# sport, not a benchmark), so switch back from the last oracle raced.
|
||||
# The monsters stay coreutils-only (busybox/toybox through 1.1 GB is a
|
||||
# spectator sport, not a benchmark), so switch back from the last oracle
|
||||
# raced.
|
||||
select_oracle coreutils || exit 1
|
||||
printf '%s\n' '--- monster: 100M lines vs coreutils ---'
|
||||
if ! run_cases lines -l 100000000; then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# bench.sh — race fastwc against GNU coreutils wc on word counts, file input.
|
||||
# Busybox wc is raced too, for shits and giggles.
|
||||
# Busybox and toybox wc are raced too, for shits and giggles.
|
||||
# Fails fast: the moment fastwc is slower than (or disagrees with) an
|
||||
# oracle wc, a human readable report is written to FAILED-benchmark.txt
|
||||
# and this script exits non-zero.
|
||||
@@ -20,10 +20,10 @@ for oracle in $ORACLES; do
|
||||
|
||||
printf 'benchmarking %s wc vs fastwc: words, file input (%s interleaved runs each, minimum kept)\n' \
|
||||
"$BENCH_NAME" "$BENCH_REPS"
|
||||
printf '%-28s %10s %22s %8s %s\n' 'test' 'wc' 'fastwc (ms µs)' 'ratio' 'status'
|
||||
printf '%-28s %16s %24s %8s %s\n' 'test' 'wc' 'fastwc (µs)' 'ratio' 'status'
|
||||
|
||||
printf '%s\n' '--- words ---'
|
||||
if ! run_cases words -w 1 10 100 1000 10000 100000; then
|
||||
if ! run_cases words -w 1 10 100 1000 10000 100000 1000000 10000000; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user