Created
July 13, 2015 05:06
-
-
Save disusered/af7c1bf0add302946bf1 to your computer and use it in GitHub Desktop.
Profiling Neovim startup
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 | |
iterations=10 | |
# ----------------------------------------------------------------------------- | |
# Create array of results | |
declare -a results | |
for i in $(seq 1 $iterations); | |
do | |
nvim --startuptime vim.log -c 'q' | |
latest=$(awk '/./{line=$0} END{print line}' vim.log | awk '{ print $1}') | |
results+=( $latest ) | |
done | |
# ----------------------------------------------------------------------------- | |
# Calculate average | |
total=0 | |
for delta in "${results[@]}" | |
do | |
total=`echo $total + $delta | bc -l` | |
done | |
average=`echo $total / $iterations | bc -l` | |
echo $average |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment