forked from premiere/premiere-libtorrent
merged RC_1_1 into master
This commit is contained in:
commit
b67166b29d
|
@ -85,6 +85,7 @@
|
||||||
* resume data no longer has timestamps of files
|
* resume data no longer has timestamps of files
|
||||||
* require C++11 to build libtorrent
|
* require C++11 to build libtorrent
|
||||||
|
|
||||||
|
* coalesce reads and writes by default on windows
|
||||||
* fixed disk I/O performance of checking hashes and creating torrents
|
* fixed disk I/O performance of checking hashes and creating torrents
|
||||||
* fix race condition in part_file
|
* fix race condition in part_file
|
||||||
* fix part_file open mode compatibility test
|
* fix part_file open mode compatibility test
|
||||||
|
|
|
@ -296,11 +296,11 @@ namespace {
|
||||||
|
|
||||||
settings_pack sett;
|
settings_pack sett;
|
||||||
sett.set_int(settings_pack::cache_size, 0);
|
sett.set_int(settings_pack::cache_size, 0);
|
||||||
sett.set_int(settings_pack::aio_threads, 1);
|
sett.set_int(settings_pack::aio_threads, 3);
|
||||||
|
|
||||||
disk_thread.set_settings(&sett);
|
disk_thread.set_settings(&sett);
|
||||||
|
|
||||||
int const piece_read_ahead = std::max(1, 15 * 1024 * 1024 / t.piece_length());
|
int const piece_read_ahead = std::max(6, 16 * 1024 * 1024 / t.piece_length());
|
||||||
|
|
||||||
hash_state st = { t, std::move(storage), disk_thread, piece_index_t(0), piece_index_t(0), f, ec };
|
hash_state st = { t, std::move(storage), disk_thread, piece_index_t(0), piece_index_t(0), f, ec };
|
||||||
for (piece_index_t i(0); i < piece_index_t(piece_read_ahead); ++i)
|
for (piece_index_t i(0); i < piece_index_t(piece_read_ahead); ++i)
|
||||||
|
|
|
@ -141,8 +141,17 @@ constexpr int CLOSE_FILE_INTERVAL = 0;
|
||||||
SET(use_read_cache, true, nullptr),
|
SET(use_read_cache, true, nullptr),
|
||||||
DEPRECATED_SET(use_write_cache, true, nullptr),
|
DEPRECATED_SET(use_write_cache, true, nullptr),
|
||||||
DEPRECATED_SET(dont_flush_write_cache, false, nullptr),
|
DEPRECATED_SET(dont_flush_write_cache, false, nullptr),
|
||||||
|
#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, nullptr),
|
||||||
|
SET(coalesce_writes, true, nullptr),
|
||||||
|
#else
|
||||||
SET(coalesce_reads, false, nullptr),
|
SET(coalesce_reads, false, nullptr),
|
||||||
SET(coalesce_writes, false, nullptr),
|
SET(coalesce_writes, false, nullptr),
|
||||||
|
#endif
|
||||||
SET(auto_manage_prefer_seeds, false, nullptr),
|
SET(auto_manage_prefer_seeds, false, nullptr),
|
||||||
SET(dont_count_slow_torrents, true, &session_impl::update_count_slow),
|
SET(dont_count_slow_torrents, true, &session_impl::update_count_slow),
|
||||||
SET(close_redundant_connections, true, nullptr),
|
SET(close_redundant_connections, true, nullptr),
|
||||||
|
@ -306,7 +315,7 @@ constexpr int CLOSE_FILE_INTERVAL = 0;
|
||||||
SET(alert_queue_size, 1000, &session_impl::update_alert_queue_size),
|
SET(alert_queue_size, 1000, &session_impl::update_alert_queue_size),
|
||||||
SET(max_metadata_size, 3 * 1024 * 10240, nullptr),
|
SET(max_metadata_size, 3 * 1024 * 10240, nullptr),
|
||||||
DEPRECATED_SET(hashing_threads, 1, nullptr),
|
DEPRECATED_SET(hashing_threads, 1, nullptr),
|
||||||
SET(checking_mem_usage, 256, nullptr),
|
SET(checking_mem_usage, 1024, nullptr),
|
||||||
SET(predictive_piece_announce, 0, nullptr),
|
SET(predictive_piece_announce, 0, nullptr),
|
||||||
SET(aio_threads, 4, &session_impl::update_disk_threads),
|
SET(aio_threads, 4, &session_impl::update_disk_threads),
|
||||||
SET(aio_max, 300, nullptr),
|
SET(aio_max, 300, nullptr),
|
||||||
|
|
|
@ -494,6 +494,26 @@ TORRENT_TEST(coalesce_writes)
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TORRENT_TEST(no_coalesce_reads)
|
||||||
|
{
|
||||||
|
using namespace libtorrent;
|
||||||
|
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);
|
||||||
|
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
TORRENT_TEST(no_coalesce_writes)
|
||||||
|
{
|
||||||
|
using namespace libtorrent;
|
||||||
|
settings_pack p;
|
||||||
|
p.set_bool(settings_pack::coalesce_writes, false);
|
||||||
|
test_transfer(0, p);
|
||||||
|
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
TORRENT_TEST(allocate)
|
TORRENT_TEST(allocate)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue