Skip to content

Commit

Permalink
Added empty system call to poll.
Browse files Browse the repository at this point in the history
On my ubuntu machine remote-expr almost always takes ~30 ms. On my arch machine
remote-expr almost always takes ~50 ms if there is a system call and ~500 ms if
there isn't. This difference canbe reprodcuced with --remote-expr 1 and
--remote-expr system('echo 1')

This means 3fd93aa actually made things slower in some cases. This CL fixes
that.
  • Loading branch information
ardagnir committed Oct 8, 2016
1 parent ada58ef commit a7993e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugin/vimbed.vim
Expand Up @@ -369,6 +369,9 @@ function! s:WriteSlice(checkInsert)
let s:old_meta = metadata
let s:old_slice_text = slice_text
call system("printf '%s%s' '" . metadata . "' ".s:ShellEscapeWithNewLines(slice_text) . " > ".s:sliceFile)
else
" For some vim/os combinations, remote-expr takes 10x as long if there is no system call.
call system("printf ''")
endif
call s:OutputMessages()
endfunction
Expand Down

0 comments on commit a7993e4

Please sign in to comment.