Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple benchmark for vim-ruby indentation
function! s:Stats(list)
let sum = 0
for item in a:list
let sum += item
endfor
let mean = sum / len(a:list)
let sum_deviations = 0
for item in a:list
let sum_deviations += (item - mean) * (item - mean)
endfor
let standard_deviation = sum_deviations / len(a:list)
return {"mean": mean, "std": standard_deviation}
endfunction
let times = []
edit indent_test_large_complex_file.rb
" edit indent_test_active_record.rb
normal! gg
for i in range(1, 10)
let start_time = reltime()
normal! =G
let end_time = reltime()
call add(times, reltimefloat(reltime(start_time, end_time)))
endfor
echomsg string(s:Stats(times))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.