Consider this python program:
import sys lc = 0 for line in open(sys.argv[1]): lc = lc + 1 print lc, sys.argv[1]
Running it on my 6GB
plain "no".
You've pretty much reached maximum disk speed.
I mean, you could mmap the file, or read it in binary chunks, and use .count('\n') or something. But that is unlikely to give major improvements.
.count('\n')