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.
https:/ /sasha- f.medium. com/why- mmap-is- faster- than-system- calls-24718e75a b37 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.