Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Mar 23, 2024
1 parent 8231e96 commit db6473b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion nano/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_executable(benchmarks entry.cpp)
add_executable(benchmarks entry.cpp stats.cpp)

target_link_libraries(benchmarks test_common benchmark::benchmark)

Expand Down
13 changes: 0 additions & 13 deletions nano/benchmarks/entry.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <nano/lib/stats.hpp>

#include <benchmark/benchmark.h>

static void BM_StringCreation (benchmark::State & state)
Expand All @@ -19,15 +17,4 @@ static void BM_StringCopy (benchmark::State & state)
}
BENCHMARK (BM_StringCopy);

static void benchmark_stats_inc (benchmark::State & state)
{
nano::stats stats;

for (auto _ : state)
{
stats.inc (nano::stat::type::ledger, nano::stat::detail::open);
}
}
BENCHMARK (benchmark_stats_inc);

BENCHMARK_MAIN ();
14 changes: 14 additions & 0 deletions nano/benchmarks/stats.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <nano/lib/stats.hpp>

#include <benchmark/benchmark.h>

static void benchmark_stats_inc (benchmark::State & state)
{
nano::stats stats;

for (auto _ : state)
{
stats.inc (nano::stat::type::ledger, nano::stat::detail::open);
}
}
BENCHMARK (benchmark_stats_inc);

0 comments on commit db6473b

Please sign in to comment.