From 8292e6dfb008e84b59fccd528776cef8ab455e93 Mon Sep 17 00:00:00 2001
From: Russel Arbore <russel.jma@gmail.com>
Date: Tue, 18 Feb 2025 21:54:06 -0600
Subject: [PATCH] Fix bench

---
 juno_samples/edge_detection/benches/edge_detection_bench.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/juno_samples/edge_detection/benches/edge_detection_bench.rs b/juno_samples/edge_detection/benches/edge_detection_bench.rs
index f7f00410..806a8865 100644
--- a/juno_samples/edge_detection/benches/edge_detection_bench.rs
+++ b/juno_samples/edge_detection/benches/edge_detection_bench.rs
@@ -64,10 +64,12 @@ fn edge_detection_bench(c: &mut Criterion) {
 
     let mut r = runner!(edge_detection);
 
+    let frames: Vec<_> = (0..num_frames).map(|_| load_frame(&mut video)).collect();
+
     group.bench_function("edge detection bench", |b| {
         b.iter(|| {
             for i in 0..num_frames {
-                let frame = load_frame(&mut video);
+                let frame = &frames[i];
                 let ptr = frame.ptr_def().unwrap() as *const f32;
 
                 assert!(frame.rows() as usize == height);
-- 
GitLab