Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
updated xy brute force test
Browse files Browse the repository at this point in the history
  • Loading branch information
martinus committed Jun 24, 2020
1 parent a22cb29 commit c268af0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/scripts/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
36 changes: 33 additions & 3 deletions src/test/unit/unit_xy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t> 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<uint32_t> data;

// fill up with ever increasing xy data
Expand Down Expand Up @@ -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<uint32_t> data;

// fill up with ever increasing xy data
Expand Down

0 comments on commit c268af0

Please sign in to comment.