From a33fcd9132fcf585dc8ddc8954c3ea0d8dbd640c Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Sat, 19 Jun 2021 15:06:50 -0500 Subject: [PATCH] spread benchmarks --- tests/benchmark_masks.nim | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tests/benchmark_masks.nim b/tests/benchmark_masks.nim index f92e8d9..5c0a550 100644 --- a/tests/benchmark_masks.nim +++ b/tests/benchmark_masks.nim @@ -33,5 +33,31 @@ timeIt "ceil": reset() -timeIt "spread": - mask.spread(10) +block spread_1: + var p: Path + p.rect(500, 500, 500, 500) + + timeIt "spread_1": + mask.fill(0) + mask.fillPath(p) + mask.spread(10) + +block spread_2: + var p: Path + p.rect(500, 500, 1000, 1000) + + timeIt "spread_2": + mask.fill(0) + mask.fillPath(p) + mask.spread(10) + +block spread_3: + timeIt "spread_3": + mask.fill(255) + mask.spread(10) + +block spread_4: + timeIt "spread_4": + mask.fill(0) + mask.setValueUnsafe(1000, 1000, 255) + mask.spread(10)