diff --git a/Bigfoot/Benchmarks/Utils/Container/SlotMap.cpp b/Bigfoot/Benchmarks/Utils/Container/SlotMap.cpp index 194e1d6..0af610c 100644 --- a/Bigfoot/Benchmarks/Utils/Container/SlotMap.cpp +++ b/Bigfoot/Benchmarks/Utils/Container/SlotMap.cpp @@ -2,16 +2,20 @@ #include #include +#include -#include #include -#include #include #include #include namespace Bigfoot { +namespace +{ +using Random = effolkronium::random_static; +} // namespace + struct MyComplexStruct { std::uint32_t m_actualValueForBench = 0; // field summed by the Iterate benchmark @@ -148,7 +152,7 @@ void Remove(benchmark::State& state) ADAPTOR adaptor; std::vector keys; keys.reserve(count); - std::mt19937 rng(0x5EEDU); + Random::seed(0x5EEDU); for (auto _: state) { @@ -159,7 +163,7 @@ void Remove(benchmark::State& state) { keys.push_back(adaptor.Add(MyComplexStruct {i})); } - std::shuffle(keys.begin(), keys.end(), rng); + Random::shuffle(keys); state.ResumeTiming(); for (const typename ADAPTOR::Key key: keys) @@ -186,8 +190,8 @@ void Get(benchmark::State& state) { keys.push_back(adaptor.Add(MyComplexStruct {i})); } - std::mt19937 rng(0x5EEDU); - std::shuffle(keys.begin(), keys.end(), rng); + Random::seed(0x5EEDU); + Random::shuffle(keys); for (auto _: state) { diff --git a/Bigfoot/Sources/Utils/CMakeLists.txt b/Bigfoot/Sources/Utils/CMakeLists.txt index 7821f22..26ed4ab 100644 --- a/Bigfoot/Sources/Utils/CMakeLists.txt +++ b/Bigfoot/Sources/Utils/CMakeLists.txt @@ -9,7 +9,8 @@ set(PublicDependencies EAStdC::EAStdC fmt::fmt flatbuffers::flatbuffers - rapidhash::rapidhash) + rapidhash::rapidhash + effolkronium_random) set(PrivateDependencies) set(BigfootPublicDependencies) set(BigfootPrivateDependencies)