Skip to content

Instantly share code, notes, and snippets.

@nbraud
Last active August 4, 2020 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbraud/fd1fea38f89a7b436fcd10d755040fad to your computer and use it in GitHub Desktop.
Save nbraud/fd1fea38f89a7b436fcd10d755040fad to your computer and use it in GitHub Desktop.
Benchmarking uutils/coreutils' factor too
#!/bin/bash
set -euo pipefail
echo "Commit id,Commit message,Mean (s),σ (s),Median (s),User (s),System (s),Min (s),Max (s)" > table.csv
for rev in $(git rev-list --reverse master..); do
git checkout "$rev"
cargo build --release
hyperfine --export-csv table.tmp.csv "seq 2 $((10 ** 7)) | ../../../target/release/factor > /dev/null"
{ echo -n "$(git show -q --format='%h,%s,')"; tail -n1 table.tmp.csv | cut -d, -f 2-; } >> table.csv
rm table.tmp.csv
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment