-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench.cpp
More file actions
29 lines (24 loc) · 702 Bytes
/
Copy pathbench.cpp
File metadata and controls
29 lines (24 loc) · 702 Bytes
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
#include "benchmark/benchmark.h"
#include "fib.hpp"
static void BM_Compile(benchmark::State& state) {
int32_t result = 0;
for (auto _ : state) {
result = IterativeFibonnaciMethod::jit_compile_function(false, 0, 0);
}
}
static void BM_CompileRunOnce(benchmark::State& state) {
int32_t result = 0;
for (auto _ : state) {
result = IterativeFibonnaciMethod::jit_compile_function(true, 20, 1);
}
}
static void BM_CompileRun1k(benchmark::State& state) {
int32_t result = 0;
for (auto _ : state) {
result = IterativeFibonnaciMethod::jit_compile_function(true, 20, 1000);
}
}
BENCHMARK(BM_Compile);
BENCHMARK(BM_CompileRunOnce);
BENCHMARK(BM_CompileRun1k);
BENCHMARK_MAIN();