|
|
|
|
|
by habibur
239 days ago
|
|
Is mmap still faster than fread? That might have been true in the 90s but I was wondering about current improvements. If you have enough free memory, the file will be cached in memory anyway instead of residing on disk. Therefore both will be reading from memory, albeit through different API. Looking for recent benchmark or view from OS developers. |
|
additionally, mmap is heavily optimized for random access, so if that’s what you’re doing, then you’ll have a much better time with it than fread.
(I hope a plug is not frowned upon here: if you like this kind of stuff, we’re a fully remote company and hiring C++ devs: https://apply.workable.com/quasar/j/436B0BEE43/ )