Closed cospectrum closed 6 months ago
Replace expensive allocation vec![vec![0i32; height]; width] with more efficient vec![0i32; height * width]
vec![vec![0i32; height]; width]
vec![0i32; height * width]
I tried with a couple of images, it's about 40% faster. And x + width * y indexing is faster than y + height * x
x + width * y
y + height * x
Thanks!
Replace expensive allocation
vec![vec![0i32; height]; width]
with more efficientvec![0i32; height * width]