neovim/neovim — pull request #1391 by splinterofchaos (2014-11-05 07:24:17+00:00)
Title: [RFC] diff: Send the text of the comparison through stdin.

Slight performance increase of `:diff[update|split]` in using `os_system()` to send the contents of the buffer. Here's my benchmark:
```vim
function! s:diff()
edit nvim/diff.c
vert diffsplit nvim/eval.c " Test for two completely different files.
new | only
edit nvim/diff.c
vert diffsplit nvim/diff.master " Two similar files.
endfunction

command! Do call s:diff()
```
And the results zooming in on the `diffsplit` lines:
```
branch total (s) self (s)
mastr 0.597878 0.269030 completely different
this 0.441984 0.233965 completely different

mastr 0.325608 0.111435 similar
this 0.256152 0.107692 similar
```
so not the most exciting results in the world. Note: I found I got the biggest performance increase when I had CPU-intensive processes running in the background. I attempted various things such as running the `diff` program as a job, using a read callback, and using `os_system()` to get the output instead of using redirection, but I actually found these made it slower. (In case anyone's curious to test it, here's my branch for running `diff` in a job: https://github.com/splinterofchaos/neovim/tree/diff-job-in)