"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "auxil/highwayhash/highwayhash/sip_hash_test.cc" between
zeek-4.0.2.tar.gz and zeek-4.0.3.tar.gz

About: Zeek (formerly Bro) is a flexible network analysis framework focusing on network security monitoring. LTS (Long Term Support) release.

sip_hash_test.cc  (zeek-4.0.2):sip_hash_test.cc  (zeek-4.0.3)
skipping to change at line 100 skipping to change at line 100
assert(size <= kMaxSize); assert(size <= kMaxSize);
static auto* res = []() { static auto* res = []() {
auto* res = new char[kMaxSize]; auto* res = new char[kMaxSize];
std::iota(res, res + kMaxSize, 0); std::iota(res, res + kMaxSize, 0);
return res; return res;
}(); }();
return res; return res;
} }
template <class Hasher> template <class Hasher>
void BM(int iters, int size) { void BM(benchmark::State& state) {
StopBenchmarkTiming(); int size = state.range(0);
auto* input = GetInput(size); auto* input = GetInput(size);
const HH_U64 keys[4] = {0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL, const HH_U64 keys[4] = {0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL,
0x1716151413121110ULL, 0x1F1E1D1C1B1A1918ULL}; 0x1716151413121110ULL, 0x1F1E1D1C1B1A1918ULL};
Hasher hasher(keys); Hasher hasher(keys);
StartBenchmarkTiming(); for (auto s : state) {
for (int i = 0; i < iters; ++i) { benchmark::DoNotOptimize(hasher(input, size));
testing::DoNotOptimize(hasher(input, size));
} }
StopBenchmarkTiming(); state.SetBytesProcessed(state.iterations() * size);
SetBenchmarkBytesProcessed(static_cast<int64>(iters) * size);
} }
void Args(::testing::Benchmark* bm) { void Args(::testing::Benchmark* bm) {
bm->DenseRange(1, 16)->Range(32, 100 << 20); bm->DenseRange(1, 16)->Range(32, 100 << 20);
} }
#define DEFINE_HASHER(hashfn, num_keys) \ #define DEFINE_HASHER(hashfn, num_keys) \
struct hashfn##er { \ struct hashfn##er { \
hashfn##er(const HH_U64* k) { memcpy(keys, k, sizeof(keys)); } \ hashfn##er(const HH_U64* k) { memcpy(keys, k, sizeof(keys)); } \
HH_U64 operator()(const char* input, size_t size) { \ HH_U64 operator()(const char* input, size_t size) { \
 End of changes. 3 change blocks. 
7 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)