FileReader::readCached currently uses the fadvise code path with POSIX_FADV_SEQUENTIAL.
I compiled AirDC++ with a modified FileReader that opens the file with BUFFER_NONE (O_DIRECT) and did a quick benchmark:
O_DIRECT: Hashing finished: 671 files (21.70 GiB) in 9 directories have been hashed in 4 minutes 10 seconds (88.62 MiB/s)
Normal caching (POSIX_FADV_SEQUENTIAL): Hashing finished: 671 files (21.70 GiB) in 9 directories have been hashed in 4 minutes 1 second (92.07 MiB/s)
AirDC++ actually has some kind of support for opening files O_DIRECT: https:/ /github. com/airdcpp/ airdcpp- windows/ blob/b863d8626d 95d0ee483572a51 39f8f569b558c3f /airdcpp/ airdcpp/ File.cpp# L380-L394 (BUFFER_NONE isn't currently being used anywhere though when opening files)
FileReader: :readCached currently uses the fadvise code path with POSIX_FADV_ SEQUENTIAL.
I compiled AirDC++ with a modified FileReader that opens the file with BUFFER_NONE (O_DIRECT) and did a quick benchmark:
O_DIRECT: Hashing finished: 671 files (21.70 GiB) in 9 directories have been hashed in 4 minutes 10 seconds (88.62 MiB/s) FADV_SEQUENTIAL ): Hashing finished: 671 files (21.70 GiB) in 9 directories have been hashed in 4 minutes 1 second (92.07 MiB/s)
Normal caching (POSIX_
Test builds for Linux: https:/ /web-builds. airdcpp. net/develop/
So O_DIRECT is slower, but not by much. I still wonder whether the difference would be bigger with different disk setups (e.g. with network disks).