Skip to content

Instantly share code, notes, and snippets.

View nbraud's full-sized avatar

nicoo nbraud

View GitHub Profile
@nbraud
nbraud / bench.sh
Last active August 4, 2020 15:13
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
@nbraud
nbraud / testcase.sh
Last active January 3, 2021 16:12
ipython#12753 crash testcase
#!/bin/sh -eu
COMMAND_STYLE="$(tput bold)$(tput setaf 4)"
NOTICE_STYLE="$(tput bold)$(tput setaf 3)"
NORMAL_STYLE="$(tput sgr0)"
run() {
echo "${COMMAND_STYLE}\$ $@${NORMAL_STYLE}"
"$@"
echo
}