Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Benchmarking modifications to prompt pure
#!/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
You can’t perform that action at this time.