diff --git a/ChangeLog b/ChangeLog index 411aabbbf..941da7752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ + * coalesce reads and writes by default on windows * fixed disk I/O performance of checking hashes and creating torrents * fix race condition in part_file * fix part_file open mode compatibility test diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index 16b152cf9..8f816696d 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -165,8 +165,17 @@ namespace libtorrent DEPRECATED_SET(use_write_cache, true, 0), DEPRECATED_SET(dont_flush_write_cache, false, 0), DEPRECATED_SET(explicit_read_cache, false, 0), +#ifdef TORRENT_WINDOWS + // the emulation of preadv/pwritev uses overlapped reads/writes to be able + // to issue them all back to back. However, it appears windows fail to + // merge them. At least for people reporting performance issues in + // qBittorrent + SET(coalesce_reads, true, 0), + SET(coalesce_writes, true, 0), +#else SET(coalesce_reads, false, 0), SET(coalesce_writes, false, 0), +#endif SET(auto_manage_prefer_seeds, false, 0), SET(dont_count_slow_torrents, true, &session_impl::update_count_slow), SET(close_redundant_connections, true, 0), diff --git a/test/test_transfer.cpp b/test/test_transfer.cpp index 41e1fedd5..91c97fada 100644 --- a/test/test_transfer.cpp +++ b/test/test_transfer.cpp @@ -447,6 +447,28 @@ TORRENT_TEST(coalesce_writes) cleanup(); } +TORRENT_TEST(no_coalesce_reads) +{ + using namespace libtorrent; + // test allowed fast + settings_pack p; + p.set_int(settings_pack::read_cache_line_size, 16); + p.set_bool(settings_pack::coalesce_reads, false); + test_transfer(0, p, false); + + cleanup(); +} + +TORRENT_TEST(no_coalesce_writes) +{ + using namespace libtorrent; + // test allowed fast + settings_pack p; + p.set_bool(settings_pack::coalesce_writes, false); + test_transfer(0, p, false); + + cleanup(); +} TORRENT_TEST(allocate) {