Skip to content

Instantly share code, notes, and snippets.

@Raimondi
Last active October 23, 2020 01:38
Show Gist options
  • Save Raimondi/9ce26a0b2f7a241a4554d177273547bd to your computer and use it in GitHub Desktop.
Save Raimondi/9ce26a0b2f7a241a4554d177273547bd to your computer and use it in GitHub Desktop.
vim -u profile.vim
FUNCTION Profile1()
Defined: ~/Documents/Source/playground/profile.vim line 2
Called 1 time
Total time: 2.985510
Self time: 2.985510
count total (s) self (s)
1 0.000020 let a = 'a'
1 0.000002 let b = 'b'
1 0.000001 let c = 'c'
1000001 0.771685 for n in range(1, a:1)
1000000 1.552987 silent echo a . b . c
1000001 0.504516 endfor
FUNCTION Profile2()
Defined: ~/Documents/Source/playground/profile.vim line 10
Called 1 time
Total time: 3.919718
Self time: 3.919718
count total (s) self (s)
1 0.000004 let a = 'a'
1 0.000001 let b = 'b'
1 0.000000 let c = 'c'
1000001 0.768153 for n in range(1,a:1)
1000000 2.499279 silent echo printf('%s%s%s', a, b, c)
1000001 0.504717 endfor
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1 3.919718 Profile2()
1 2.985510 Profile1()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
1 3.919718 Profile2()
1 2.985510 Profile1()
set nocp
function! Profile1(...)
let a = 'a'
let b = 'b'
let c = 'c'
for n in range(1, a:1)
silent echo a . b . c
endfor
endfunction
function! Profile2(...)
let a = 'a'
let b = 'b'
let c = 'c'
for n in range(1,a:1)
silent echo printf('%s%s%s', a, b, c)
endfor
endfunction
profile start /Users/israel/Documents/Source/playground/profile.txt
profile func Profile*
se lazyredraw
let times = 1000000
call Profile1(times)
call Profile2(times)
quit!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment