Created
July 22, 2015 21:14
-
-
Save mafredri/7625b223db6c2a1200f4 to your computer and use it in GitHub Desktop.
Benchmarking modifications to prompt pure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
BRANCH=$1 | |
BRANCHES=(master pure-nitro pure-nitro2) | |
BENCHDIR=benchmark | |
ROUNDS=100 | |
if [[ ! -n $BRANCH ]]; then | |
[[ ! -d $BENCHDIR ]] && mkdir $BENCHDIR | |
for i in $BRANCHES; do | |
./pure_benchmark.zsh $i | |
done | |
local header="--header-out" | |
for i in $BENCHDIR/*.log; do | |
sort $i | datamash $header sum 1 max 1 min 1 mean 1 median 1 | |
unset header | |
done | |
exit 0 | |
fi | |
print "Testing: $BRANCH" | |
git checkout $BRANCH &>/dev/null | |
LOG="$BENCHDIR/${BRANCH}.log" | |
. ./async.zsh | |
async | |
. ./pure.zsh | |
prompt_pure_setup | |
# disable async job, not relevant for the purpose of this test | |
unset async_job | |
async_job() { } | |
float -F time | |
print -n |> $LOG | |
for i in {1..$ROUNDS}; do | |
time=$EPOCHREALTIME | |
prompt_pure_precmd &>/dev/null | |
(( time = EPOCHREALTIME - time )) | |
print $time >> $LOG | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment