You can use vim own profiling mechanism:
vim --cmd profile start profile.log
--cmd profile func *
--cmd profile file *
-c profdel func *
-c profdel file *
-c qa!
After running the above you will find a file called profile.log in the current directory with all required information. To get per-script information table similar to already present per-function one, use (after opening this file in vim):
" Open profile.log file in vim first
let timings=[]
g/^SCRIPT/call add(timings, [getline( . )[len( SCRIPT ):], matchstr(getline(line( . )+1), ^Sourced zsd+ )]+map(getline(line( . )+2, line( . )+3), matchstr(v:val, d+.d+$ ) ))
enew
call setline( . , [ count total (s) self (s) script ]+map(copy(timings), printf("%5u %9s %8s %s", v:val[1], v:val[2], v:val[3], v:val[0]) ))
It will be unsorted, but you can always use built-in :sort
command if number of scripts is too large.