Log execution times for system() and getLocListRaw().

This commit is contained in:
LCD 47 2016-05-27 07:06:13 +03:00
parent 95879f19a9
commit 6e467b8930
3 changed files with 10 additions and 1 deletions

View File

@ -37,13 +37,19 @@ function! syntastic#util#system(command) abort " {{{2
let $LC_MESSAGES = 'C' let $LC_MESSAGES = 'C'
let $LC_ALL = '' let $LC_ALL = ''
let cmd_start = reltime()
let out = system(a:command) let out = system(a:command)
let cmd_time = split(reltimestr(reltime(cmd_start)))[0]
let $LC_ALL = old_lc_all let $LC_ALL = old_lc_all
let $LC_MESSAGES = old_lc_messages let $LC_MESSAGES = old_lc_messages
let &shell = old_shell let &shell = old_shell
if exists('g:_SYNTASTIC_DEBUG_TRACE')
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'system: command run in ' . cmd_time . 's')
endif
return out return out
endfunction " }}}2 endfunction " }}}2

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START lockvar! g:_SYNTASTIC_START
endif endif
let g:_SYNTASTIC_VERSION = '3.7.0-139' let g:_SYNTASTIC_VERSION = '3.7.0-140'
lockvar g:_SYNTASTIC_VERSION lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1 " Sanity checks {{{1

View File

@ -91,6 +91,7 @@ function! g:SyntasticChecker.getExecEscaped() abort " {{{2
endfunction " }}}2 endfunction " }}}2
function! g:SyntasticChecker.getLocListRaw() abort " {{{2 function! g:SyntasticChecker.getLocListRaw() abort " {{{2
let checker_start = reltime()
let name = self._filetype . '/' . self._name let name = self._filetype . '/' . self._name
if has_key(self, '_enable') if has_key(self, '_enable')
@ -128,6 +129,8 @@ function! g:SyntasticChecker.getLocListRaw() abort " {{{2
call self._populateHighlightRegexes(list) call self._populateHighlightRegexes(list)
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, name . ' raw:', list) call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, name . ' raw:', list)
call self._quietMessages(list) call self._quietMessages(list)
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE,
\ 'getLocList: checker ' . name . ' run in ' . split(reltimestr(reltime(checker_start)))[0] . 's')
return list return list
endfunction " }}}2 endfunction " }}}2