Skip to content

Instantly share code, notes, and snippets.

@disusered
Created July 13, 2015 05:06
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save disusered/af7c1bf0add302946bf1 to your computer and use it in GitHub Desktop.
Save disusered/af7c1bf0add302946bf1 to your computer and use it in GitHub Desktop.
Profiling Neovim startup
#!/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