File: MemoryPool_bench.cpp

package info (click to toggle)
encfs 1.9.5-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 13,560 kB
  • sloc: cpp: 77,790; python: 9,665; xml: 3,888; sh: 995; perl: 866; makefile: 513; ansic: 213; exp: 16; sed: 16
file content (14 lines) | stat: -rw-r--r-- 333 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "benchmark/benchmark.h"

#include "encfs/MemoryPool.h"

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);