MCPcopy Create free account
hub / github.com/FastLED/FastLED / run_benchmark

Function run_benchmark

tests/fl/gfx/blur.cpp:282–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280
281template <int R, int W, int H>
282__attribute__((noinline)) static void run_benchmark(const char *label, int iters) {
283 constexpr int N = W * H;
284 static CRGB px[N]; // static to avoid stack overflow with ASAN
285
286 auto t = bench(
287 [&]() {
288 fill_test_data(px, N);
289 gfx::Canvas<CRGB> c(fl::span<CRGB>(px, N), W, H);
290 gfx::blurGaussian<R, R>(c);
291 },
292 iters);
293
294 char buf[80];
295 fl::snprintf(buf, sizeof(buf), " %s: %d ns/iter", label,
296 static_cast<int>(t));
297 fl::println(buf);
298}
299
300template <int R, int W, int H>
301__attribute__((noinline)) static void run_benchmark_blur_only(const char *label, int iters) {

Callers

nothing calls this directly

Calls 4

benchFunction · 0.85
fill_test_dataFunction · 0.85
snprintfFunction · 0.85
printlnFunction · 0.50

Tested by

no test coverage detected