From c268af02cfa16aa8a977c7aac785e58504f1688d Mon Sep 17 00:00:00 2001 From: Martin Ankerl Date: Wed, 24 Jun 2020 07:11:52 +0200 Subject: [PATCH] updated xy brute force test --- src/scripts/test_all.sh | 2 +- src/test/unit/unit_xy.cpp | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/scripts/test_all.sh b/src/scripts/test_all.sh index 54124d44..59342da8 100755 --- a/src/scripts/test_all.sh +++ b/src/scripts/test_all.sh @@ -35,7 +35,7 @@ function build() { build "g++-4.9" "11" "OFF" "-m32" build "g++-4.9" "14" "OFF" "-m32" -build "clang++-6" "20" "OFF" +#build "clang++-6" "20" "OFF" build "clang++" "20" "ON" diff --git a/src/test/unit/unit_xy.cpp b/src/test/unit/unit_xy.cpp index 2c525734..00a6d77c 100644 --- a/src/test/unit/unit_xy.cpp +++ b/src/test/unit/unit_xy.cpp @@ -9,12 +9,41 @@ namespace { inline uint32_t modify(uint32_t x) { - return x; + return robin_hood::detail::rotr(x, 16U); } } // namespace -TEST_CASE("xy" * doctest::skip()) { +TEST_CASE("fill_x" * doctest::skip()) { + std::cout << "fill_x" << std::endl; + robin_hood::unordered_flat_set data; + + // fill up with ever increasing xy data + uint32_t x = 0; + uint32_t y = 0; + + auto begin = std::chrono::steady_clock::now(); + size_t oldMask = 0; + while (data.size() < 500000000) { + data.insert(modify(x++)); + + if (data.mask() != oldMask) { + auto end = std::chrono::steady_clock::now(); + std::cout << std::setw(15) << std::chrono::nanoseconds(end - begin).count() + << " ns: " << data.size() << " " << (data.mask() + 1) << " " << x << " " << y + << std::endl; + + oldMask = data.mask(); + } + } + auto end = std::chrono::steady_clock::now(); + std::cout << std::setw(15) << std::chrono::nanoseconds(end - begin).count() + << " ns: " << data.size() << " " << (data.mask() + 1) << " " << x << " " << y + << std::endl; +} + +TEST_CASE("fill_xy" * doctest::skip()) { + std::cout << "fill_xy" << std::endl; robin_hood::unordered_flat_set data; // fill up with ever increasing xy data @@ -49,7 +78,8 @@ TEST_CASE("xy" * doctest::skip()) { << std::endl; } -TEST_CASE("xyz" * doctest::skip()) { +TEST_CASE("fill_xyz" * doctest::skip()) { + std::cout << "fill_xyz" << std::endl; robin_hood::unordered_flat_set data; // fill up with ever increasing xy data