I want to read a huge file in my code. Is read() or readline() faster for this. How about the loop:
for line in fileHandle
If you have enough memory use readline if performance is a concern. I have seen that while using a gzip file doing: read().split('\n') took 5 seconds to loop through, whereas using the iterator took 38 seconds. The size of GZ file was around 45 MB.
read().split('\n')