Skip to content

Instantly share code, notes, and snippets.

@disusered
Created July 13, 2015 05:06
Show Gist options
  • 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