Created
April 21, 2015 16:16
-
-
Save r9y9/3c54930fcf5f68b287ff to your computer and use it in GitHub Desktop.
Easy vim benchmark (e.g: ./vim_benchmark.sh 10)
This file contains 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
#!/bin/bash | |
# e.g. bash vim_benchmark.sh 10 | |
LOGFILE=$(mktemp) | |
ITER=$1 | |
function echo_mean_and_std() { | |
m=$(grep "editing files" $1 | awk 'BEGIN{m=0.0} {m+=$1} END{print m/NR}') | |
v=$(grep "editing files" $1 | awk 'BEGIN{v=0.0} {v+=($1-'"$m"')*($1-'"$m"')} END{if (NR-1 > 0) print sqrt(v/(NR-1)); else print "NaN"}') | |
echo -n "mean: $m, std: $v" | |
} | |
for i in $(seq 1 1 $ITER) | |
do | |
echo -n "$i/$ITER trying.. " | |
vim --startuptime $LOGFILE -c ":quit" | |
echo_mean_and_std $LOGFILE | |
echo "" | |
done | |
echo "Finished!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sample output meatured in my environment.