Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2020-09-07 21:57:27 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2020-09-07 21:57:27 +0300
commite52cc883d48207aa3e1e52ca22072bcda2f4ee6d (patch)
tree9cf7a20d21756baf25f070b5cf191dfbc4b22a00 /test
parente5fc567e29066d836db8286d3d86c8e4eef49b54 (diff)
Fix the poor performance of the previous commits fixing the race condition in tear down of mapped files on Windows.
Diffstat (limited to 'test')
-rw-r--r--test/tests/issue0009.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/tests/issue0009.cpp b/test/tests/issue0009.cpp
index ca15cf43..ac06e445 100644
--- a/test/tests/issue0009.cpp
+++ b/test/tests/issue0009.cpp
@@ -87,7 +87,22 @@ static inline void TestIssue09b()
BOOST_CHECK(diff < 250);
}
+static inline void TestIssue09c()
+{
+ namespace llfio = LLFIO_V2_NAMESPACE;
+ auto begin = std::chrono::steady_clock::now();
+ auto mfh = llfio::mapped_file_handle::mapped_temp_file(1ULL << 40ULL).value();
+ mfh.truncate(100 * 1024).value();
+ mfh.close().value();
+ auto end = std::chrono::steady_clock::now();
+ auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count();
+ std::cout << "Construct and tear down a small mapped_file_handle with a reservation of 2^40 took " << diff << "ms." << std::endl;
+ BOOST_CHECK(diff < 250);
+}
+
KERNELTEST_TEST_KERNEL(regression, llfio, issues, 9a,
"Tests issue #9 map_handle and mapped_file_handle are very slow with large address reservations on Windows", TestIssue09a())
KERNELTEST_TEST_KERNEL(regression, llfio, issues, 9b,
"Tests issue #9 map_handle and mapped_file_handle are very slow with large address reservations on Windows", TestIssue09b())
+KERNELTEST_TEST_KERNEL(regression, llfio, issues, 9c,
+ "Tests issue #9 map_handle and mapped_file_handle are very slow with large address reservations on Windows", TestIssue09c())