I\'ve profiled some legacy code I\'ve inherited with cProfile. There were a bunch of changes I\'ve already made that have helped (like using simplejson\'s C extensions!). >
You can do mmap in python, which might help. But I suspect you did some mistake while profiling, because 7k * 1500 in 20 seconds is about 0.5 Mbytes/s. Do a test in which you write random lines with the same length, and you will see it's much faster than that.