title: Python: efficient file io
body: <p>What is the most efficient (fastest) way to simultaneously read in two large files and do some processing?</p>
  
  <p>I have two files; a.txt and b.txt, each containing about a hundred thousand corresponding lines. My goal is to read in the two files and then do some processing on each line pair</p>
  
  <pre><code>def kernel:
      a_file=open('a.txt','r')
      b_file=open('b.txt', 'r')
      a_line = a_file.readline()
      b_line = b_file.readline()
      while a_line:
          process(a_spl,b_spl) #process requiring both corresponding file lines
  </code></pre>
  
  <p>I looked in to xreadlines and readlines but i'm wondering if i can do better. speed is of paramount importance for this task.</p>
  
  <p>thank you.</p>