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

Function run_benchmark_blur_only

tests/fl/gfx/blur.cpp:301–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299
300template <int R, int W, int H>
301__attribute__((noinline)) static void run_benchmark_blur_only(const char *label, int iters) {
302 constexpr int N = W * H;
303 static CRGB px[N]; // static to avoid stack overflow with ASAN
304 fill_test_data(px, N); // fill once before benchmark
305
306 auto t = bench(
307 [&]() {
308 gfx::Canvas<CRGB> c(fl::span<CRGB>(px, N), W, H);
309 gfx::blurGaussian<R, R>(c);
310 },
311 iters);
312
313 char buf[80];
314 fl::snprintf(buf, sizeof(buf), " %s: %d ns/iter", label,
315 static_cast<int>(t));
316 fl::println(buf);
317}
318
319FL_TEST_CASE("blur benchmark") {
320 // Debug builds use -Og (optimized for debugging) which provides enough

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected