read multiple files using multiprocessing

后端 未结 3 1560
离开以前
离开以前 2020-12-10 18:23

I need to read some very huge text files (100+ Mb), process every lines with regex and store the data into a structure. My structure inherits from defaultdict, it has a read

3条回答
  •  星月不相逢
    2020-12-10 18:41

    Multiprocessing is more suited to CPU- or memory-oriented processes since the seek time of rotational drives kills performance when switching between files. Either load your log files into a fast flash drive or some sort of memory disk (physical or virtual), or give up on multiprocessing.

提交回复
热议问题