Looking at the example code the OP posted, I think there is a misunderstanding of what Python is doing.
Ie:
"Reading in line by line"
import codecs
for i in codecs.open('unicodefile','r','utf8'):
print i
The above looks like it is reading in line by line. However, Python interprets this as "read as much of the file into memory, and then process each as a line". So in effect, the above for loop reads everything into memory.
"Reading into RAM"
import codecs
for i in codecs.open('unicodefile','r','utf8').readlines():
print i
I believe that the above is practically the same as the "line by line" example above. Ie, Python is reading it all into memory.
If you had wanted to test the line-by-line performance, you would need the "readline()" and not "readlines()" or the unspecified for loop, which may imply "readlines()". This is noted elsewhere in the StackOverflow site.
Another aspect to consider is filesystem buffering. If you are running the same bit of code against the same file, then you run the risk of filesystem buffering polluting the results. As you say, you have 200GB of ram, that is more than enough to buffer enough of the file to impact run results.
You would need to do the following to ensure clean test results:
1) copy the large file from a known source to a new filename. (Filesystem needs to be not a COW filesystem.)
2) flush the filesystem cache
3) run the first test against the file.
4) delete the file
5) re-copy the file from source to another new filename.
6) flush the filesystem cache
7) run the second test against the new file.
That will give you a more accurate test of file load times.
If you want to load the whole of the file into memory all at once, wouldn't the filehandle.read(bytes to read) potentially provide a faster means of block reading in the file contents?
In either case, for reference:
http://docs.python.org/2/tutorial/inputoutput.html
import timeit; timeit.timeit('''for i in codecs.open('unicodefile','r','utf8'): print i''', 'import codecs')
then do the same for the second case.