mmap slower than getline?

后端 未结 4 939
小鲜肉
小鲜肉 2020-12-29 14:17

I face the challenge of reading/writing files (in Gigs) line by line.

Reading many forum entries and sites (including a bunch of SO\'s), mmap was suggested as the f

4条回答
  •  感动是毒
    2020-12-29 15:00

    You can use memchr to find line endings. It will be much faster than adding to a stringstream one character at a time.

提交回复
热议问题