Could imfilter use the secret sauce from the specialization for OffsetArray in more cases? I've not wrapped my head fully around all the indexing permutations, but here's a simple benchmark test case:
BenchmarkTools.Trial:
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 11.882 ms (0.00% GC)
median time: 11.904 ms (0.00% GC)
mean time: 11.910 ms (0.00% GC)
maximum time: 13.976 ms (0.00% GC)
--------------
samples: 420
evals/sample: 1
Theoretically, I think this could be faster as it does fewer computations than the one above (it skips the outside edge, yes?), but it falls back to the generic implementation:
Could imfilter use the secret sauce from the specialization for OffsetArray in more cases? I've not wrapped my head fully around all the indexing permutations, but here's a simple benchmark test case:
This hits the fast
OffsetArray
implementation:Theoretically, I think this could be faster as it does fewer computations than the one above (it skips the outside edge, yes?), but it falls back to the generic implementation:
This restores a bit of performance and hits the specialized method, but it's still a bit slower: