Comment 11 for bug 1909861

Revision history for this message
cologic (cologic) wrote :

https://sasha-f.medium.com/why-mmap-is-faster-than-system-calls-24718e75ab37 profiles mmap()-based file reading versus what looks like what DC++ calls readCached().

mmap() is significantly faster in those experiments, so while my response here was to just remove the associated code, given DC++'s target platforms and lack of testing on Linux, there's some potential argument for getting mmap(), with all the multithreaded signaling issues, to work in general. It doesn't compare O_DIRECT/FILE_FLAG_NO_BUFFERING, which should avoid copy_user_enhanced_fast_string, or its Windows equivalent, from consuming most of the file-reading time.

So that's another dimension one might measure: CPU usage for reading during hashing. It might not matter enough to decide things, since the TTH probably overwhelms the file read per se, but it's an mmap() use case.