|
9 | 9 | namespace {
|
10 | 10 |
|
11 | 11 | inline uint32_t modify(uint32_t x) {
|
12 |
| - return x; |
| 12 | + return robin_hood::detail::rotr(x, 16U); |
13 | 13 | }
|
14 | 14 |
|
15 | 15 | } // namespace
|
16 | 16 |
|
17 |
| -TEST_CASE("xy" * doctest::skip()) { |
| 17 | +TEST_CASE("fill_x" * doctest::skip()) { |
| 18 | + std::cout << "fill_x" << std::endl; |
| 19 | + robin_hood::unordered_flat_set<uint32_t> data; |
| 20 | + |
| 21 | + // fill up with ever increasing xy data |
| 22 | + uint32_t x = 0; |
| 23 | + uint32_t y = 0; |
| 24 | + |
| 25 | + auto begin = std::chrono::steady_clock::now(); |
| 26 | + size_t oldMask = 0; |
| 27 | + while (data.size() < 500000000) { |
| 28 | + data.insert(modify(x++)); |
| 29 | + |
| 30 | + if (data.mask() != oldMask) { |
| 31 | + auto end = std::chrono::steady_clock::now(); |
| 32 | + std::cout << std::setw(15) << std::chrono::nanoseconds(end - begin).count() |
| 33 | + << " ns: " << data.size() << " " << (data.mask() + 1) << " " << x << " " << y |
| 34 | + << std::endl; |
| 35 | + |
| 36 | + oldMask = data.mask(); |
| 37 | + } |
| 38 | + } |
| 39 | + auto end = std::chrono::steady_clock::now(); |
| 40 | + std::cout << std::setw(15) << std::chrono::nanoseconds(end - begin).count() |
| 41 | + << " ns: " << data.size() << " " << (data.mask() + 1) << " " << x << " " << y |
| 42 | + << std::endl; |
| 43 | +} |
| 44 | + |
| 45 | +TEST_CASE("fill_xy" * doctest::skip()) { |
| 46 | + std::cout << "fill_xy" << std::endl; |
18 | 47 | robin_hood::unordered_flat_set<uint32_t> data;
|
19 | 48 |
|
20 | 49 | // fill up with ever increasing xy data
|
@@ -49,7 +78,8 @@ TEST_CASE("xy" * doctest::skip()) {
|
49 | 78 | << std::endl;
|
50 | 79 | }
|
51 | 80 |
|
52 |
| -TEST_CASE("xyz" * doctest::skip()) { |
| 81 | +TEST_CASE("fill_xyz" * doctest::skip()) { |
| 82 | + std::cout << "fill_xyz" << std::endl; |
53 | 83 | robin_hood::unordered_flat_set<uint32_t> data;
|
54 | 84 |
|
55 | 85 | // fill up with ever increasing xy data
|
|
0 commit comments