-
-
Save stonecharioteer/1d5eea7bd1fcd450daea77a64852cc56 to your computer and use it in GitHub Desktop.
Profiling Neovim startup
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
#!/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