title: How to compare two files (~50MB) fast?
body: <p>I am using Python and want to compare two files and find the lines that are unique to each of them. I'm doing as shown below, but it is too slow.</p>
  
  <pre><code>f1 = open(file1)
  text1Lines = f1.readlines()
  f2 = open(file2)
  text2Lines = f2.readlines()
  diffInstance=difflib.Differ()
  diffList = list(diffInstance.compare(text1Lines, text2Lines))
  </code></pre>
  
  <p>How can I speed it up considerably?</p>