encfs/test/MemoryPool_bench.cpp

15 lines
333 B
C++
Raw Normal View History

2017-08-06 18:47:33 +02:00
#include "benchmark/benchmark.h"
#include "encfs/MemoryPool.h"
2017-08-06 18:47:33 +02:00
using namespace encfs;
static void BM_MemPoolAllocate(benchmark::State& state) {
while (state.KeepRunning()) {
auto block = MemoryPool::allocate(1024);
MemoryPool::release(block);
}
}
// Register the function as a benchmark
BENCHMARK(BM_MemPoolAllocate);