Speed up writing to files

后端 未结 3 1932
醉梦人生
醉梦人生 2020-12-03 05:20

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!).

3条回答
  •  感动是毒
    2020-12-03 05:45

    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.

提交回复
热议问题