3 ms·
Very nice website, it's very well done. Regarding performance, I don't see what makes this high-performance. I looked into the code for filters and it's a very
by mratsim 6y ago
Very nice website, it's very well done.
Regarding performance, I don't see what makes this high-performance. I looked into the code for filters and it's a very naive translation of the algorithms.
Naive not in the pejorative way, you can only do so much on images stored as contiguous RGB (arrays of struct), even OpenCV does not really optimize for this.
Non-naive implementations of filters would use tiling, register blocking, register rotation to avoid being bottlenecked by memory which is the main issue with stencil code. I don't think vectorization is straightforward with the RGB layout since you would need both scatter and gather instructions but gather requires AVX2 and scatter is very manual.
Anyway the benchmark should use a reference C or C++ library or even imageflow that is also written in Rust https://github.com/imazen/imageflow https://github.com/imazen/imageflow.
Bonus point if you benchmark against Halide (https://halide-lang.org/ https://halide-lang.org/) or Taichi (http://taichi.graphics/ http://taichi.graphics/) and you're only 20 times slower (see their box blur example: https://github.com/halide/Halide/blob/master/apps/blur/halide_blur_generator.cpp https://github.com/halide/Halide/blob/master/apps/blur/halid...)