|
@ -316,16 +316,17 @@ struct buddy_fuzz_test : public test_scaffold { |
|
|
} |
|
|
} |
|
|
auto reference = std::chrono::steady_clock::now() - start; |
|
|
auto reference = std::chrono::steady_clock::now() - start; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::cout |
|
|
|
|
|
<< "Fuzzing timed at " |
|
|
|
|
|
<< std::chrono::duration_cast<std::chrono::microseconds>(duration).count() |
|
|
|
|
|
<< "µs for " |
|
|
|
|
|
<< FUZZ_STRENGTH |
|
|
|
|
|
<< " (reference: " |
|
|
|
|
|
<< std::chrono::duration_cast<std::chrono::microseconds>(reference).count() |
|
|
|
|
|
<< "µs)" |
|
|
|
|
|
<< std::endl; |
|
|
|
|
|
|
|
|
if(do_bench){ |
|
|
|
|
|
std::cout |
|
|
|
|
|
<< "Fuzzing timed at " |
|
|
|
|
|
<< std::chrono::duration_cast<std::chrono::microseconds>(duration).count() |
|
|
|
|
|
<< "µs for " |
|
|
|
|
|
<< FUZZ_STRENGTH |
|
|
|
|
|
<< " (reference: " |
|
|
|
|
|
<< std::chrono::duration_cast<std::chrono::microseconds>(reference).count() |
|
|
|
|
|
<< "µs)" |
|
|
|
|
|
<< std::endl; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return res; |
|
|
return res; |
|
|
} |
|
|
} |
|
@ -688,3 +689,63 @@ struct endian_test : public test_scaffold { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
append_test dummy_45zelotf5f5(new endian_test{}); |
|
|
append_test dummy_45zelotf5f5(new endian_test{}); |
|
|
|
|
|
|
|
|
|
|
|
struct alloc_bench_test : public test_scaffold { |
|
|
|
|
|
alloc_bench_test() { |
|
|
|
|
|
name = __FILE__ ":12"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
virtual int run() { |
|
|
|
|
|
int res = 0; |
|
|
|
|
|
auto store = std::make_unique<std::array<char, 1 << 16>>(); |
|
|
|
|
|
using buddy_loc = gp::buddy<>; |
|
|
|
|
|
using arena_loc = gp::arena<>; |
|
|
|
|
|
buddy_loc bud{&*store->begin(), store->size()}; |
|
|
|
|
|
arena_loc are{&*store->begin(), store->size()}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(size_t divider = 2; divider < 32; ++divider) |
|
|
|
|
|
{ |
|
|
|
|
|
gp::ring_list<int, buddy_loc> a{bud}; |
|
|
|
|
|
gp::ring_list<int, arena_loc> b{are}; |
|
|
|
|
|
|
|
|
|
|
|
std::cout << |
|
|
|
|
|
"ARE | " << "INS | " << divider << " | " << |
|
|
|
|
|
time_operation([&](){ |
|
|
|
|
|
for(size_t i = 0; i < store->size()/sizeof(gp::ring_list<int, arena_loc>::node)/divider; i++) { |
|
|
|
|
|
b.insert(i); |
|
|
|
|
|
} |
|
|
|
|
|
}).count() << std::endl; |
|
|
|
|
|
|
|
|
|
|
|
std::cout << |
|
|
|
|
|
"ARE | " << "DEL | " << divider << " | " << |
|
|
|
|
|
time_operation([&](){ |
|
|
|
|
|
for(size_t i = 0; i < store->size()/sizeof(gp::ring_list<int, arena_loc>::node)/divider; i++) { |
|
|
|
|
|
gp::ring_list<int, arena_loc>::explorer e = b.explore(); |
|
|
|
|
|
b.remove(e); |
|
|
|
|
|
} |
|
|
|
|
|
}).count() << std::endl; |
|
|
|
|
|
|
|
|
|
|
|
std::cout << |
|
|
|
|
|
"BUD | " << "INS | " << divider << " | " << |
|
|
|
|
|
time_operation([&](){ |
|
|
|
|
|
for(size_t i = 0; i < store->size()/sizeof(gp::ring_list<int, buddy_loc>::node)/divider; i++) { |
|
|
|
|
|
a.insert(i); |
|
|
|
|
|
} |
|
|
|
|
|
}).count() << std::endl; |
|
|
|
|
|
|
|
|
|
|
|
std::cout << |
|
|
|
|
|
"BUD | " << "DEL | " << divider << " | " << |
|
|
|
|
|
time_operation([&](){ |
|
|
|
|
|
for(size_t i = 0; i < store->size()/sizeof(gp::ring_list<int, buddy_loc>::node)/divider; i++) { |
|
|
|
|
|
gp::ring_list<int, buddy_loc>::explorer e = a.explore(); |
|
|
|
|
|
a.remove(e); |
|
|
|
|
|
} |
|
|
|
|
|
}).count() << std::endl; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return res; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
append_test dummy_jhgspo5d5(new alloc_bench_test{}); |