BigFile/Sasquatch #1
@@ -2,16 +2,20 @@
|
||||
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <effolkronium/random.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <random>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
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<typename ADAPTOR::Key> 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)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,8 @@ set(PublicDependencies
|
||||
EAStdC::EAStdC
|
||||
fmt::fmt
|
||||
flatbuffers::flatbuffers
|
||||
rapidhash::rapidhash)
|
||||
rapidhash::rapidhash
|
||||
effolkronium_random)
|
||||
set(PrivateDependencies)
|
||||
set(BigfootPublicDependencies)
|
||||
set(BigfootPrivateDependencies)
|
||||
|
||||
Reference in New Issue
Block a user