Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
6 changes: 6 additions & 0 deletions content/posts/2023/02/benchmarking/create_src_archive
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
tar -cf benchmarking_the_world.tar \
--transform 's,^,benchmarking_the_world/,' \
*.hpp \
*.cpp \
meson.build
13 changes: 13 additions & 0 deletions content/posts/2023/02/benchmarking/google_micro.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <benchmark/benchmark.h>
#include "sum.hpp"

static void BM_Sum(benchmark::State& state) {
for (auto _ : state) {
benchmark::DoNotOptimize(sum(state.range(0), state.range(1)));
}
state.SetComplexityN(state.range(0) + state.range(1));
}

BENCHMARK(BM_Sum)->Args({1, 2})->Args({10, 20})->Complexity();

BENCHMARK_MAIN();
Loading