Side by side diff of large files

diff()

I have two ~1 GB files that I want to do a side by side diff of. Solutions I have tried:

  • diff – Works quickly but doesn't output side-by-side.
  • diff -y or sdiff – This outputs side-by-side but it outputs the entire file – not just the changes, so they are impossible to find.
  • icdiff – Just too slow (it's written in Python so no surprise there).
  • ydiff – Not actually tried but it is also written in Python so I assume it will also be very slow.
  • KDiff3 – Crashed.
  • Xcode FileMerge – Too slow (gave it a few minutes of non-responsiveness).
  • Beyond Compare – Max 500MB limit.
  • Meld – Made a little progress but far too slow to be useful.
  • vimdiff – Loads the files successfully and actually displays a side-by-side diff, but the colour scheme makes it unreadable, and normal things that you'd expect from a sane program do not work, e.g. pressing up to scroll up.

Best Answer

The best I have so far is:

diff -y --suppress-common-lines --speed-large-files file1 file2

However unfortunately that doesn't show you any context lines.

I found another solution using grep which seemed ok but it uses a regex and is just too slow.

Related Question