Loading large diffs is slow
vfaronov opened this issue · 0 comments
vfaronov commented
Gunison reads diff output in chunks of up to 64 KiB (the current buffer size in watchUnison
). After each chunk, Gunison runs a regexp (looking for the end of diff) on the entire diff output received so far. For large diffs that take many chunks to read, this gets quadratically slow.
One way to fix this would be to postpone core.ProcOutput
until Gunison gets a short read or a timeout, indicating that Unison/diff has stopped writing.
But I’m not sure this is worth fixing, because:
- diffs many times larger than 64 KiB must be rare;
- regardless, users are better off configuring Unison to use a GUI
diff
tool (such asmeld
) that doesn’t write to stdout at all.