blob: 4e7155cdb40eb5e5d78674394e7e49b9ebd0d102 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#include "mockDefs.h"
#include <benchmark/benchmark.h>
#include <volume.h>
using namespace GitFS;
using namespace GitFS::Test;
const Service globalService;
struct BenchmarkClient : public benchmark::Fixture {
NetFS::ReqEnv re {"root", "root"};
std::string root {"/"}, deep {"/unittests/fixtures/executable"};
};
BENCHMARK_F(BenchmarkClient, statfs_root)(benchmark::State & state)
{
VolumeClient v;
for (auto _ : state) {
benchmark::DoNotOptimize(v.v->statfs(re, root));
}
}
BENCHMARK_F(BenchmarkClient, getattr_root)(benchmark::State & state)
{
VolumeClient v;
for (auto _ : state) {
benchmark::DoNotOptimize(v.v->getattr(re, root));
}
}
BENCHMARK_F(BenchmarkClient, getattr_deep)(benchmark::State & state)
{
VolumeClient v;
for (auto _ : state) {
benchmark::DoNotOptimize(v.v->getattr(re, root));
}
}
BENCHMARK_F(BenchmarkClient, listdir_src)(benchmark::State & state)
{
VolumeClient v;
const std::string src {"/src"};
auto dir = v.v->opendir(re, src);
for (auto _ : state) {
benchmark::DoNotOptimize(dir->listdir());
}
dir->close();
}
BENCHMARK_MAIN();
|