Files
esphome/tests/benchmarks/core/bench_helpers.cpp
T
J. Nick Koston a92147e1c9 Remove BM_ prefix, drop application loop benchmark, fix core includes
- Remove BM_ prefix from all benchmark names (unnecessary convention)
- Remove bench_application_loop.cpp (App needs pre_setup/setup which
  requires full code generation; will revisit as integration benchmark)
- Fix extra_include_dirs to use os.path.relpath for sibling directories
2026-03-16 22:27:03 -10:00

27 lines
554 B
C++

#include <benchmark/benchmark.h>
#include "esphome/core/helpers.h"
namespace esphome::benchmarks {
// --- random_float() ---
// Ported from ol.yaml:148 "Random Float Benchmark"
static void RandomFloat(benchmark::State &state) {
for (auto _ : state) {
benchmark::DoNotOptimize(random_float());
}
}
BENCHMARK(RandomFloat);
// --- random_uint32() ---
static void RandomUint32(benchmark::State &state) {
for (auto _ : state) {
benchmark::DoNotOptimize(random_uint32());
}
}
BENCHMARK(RandomUint32);
} // namespace esphome::benchmarks