-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hardcoded filter3x3 function to benchmark current generic filter function against #644
Comments
This issue is to add an implementation of filter3x3 along the lines of what we had when this library was first written - a raw loop that averages the pixel values at 9 fixed offsets from the current coordinate - to check that we don’t accidentally end up with an implementation that’s slower than that for this use case. |
The filter has become 4 times slower |
|
Not if the compiler optimizes it out, which I'm curious about seeing as it was the same speed as the previous implementation according my benchmarking. I'm hoping the One method would be if |
@cospectrum which versions are you comparing? |
|
Ouch. I’ll take a look today. @ripytide has benchmarks showing no impact at #608 (comment) so something is odd here. |
Comparing v0.25.0 and current master (5e00bd1) on a 2021 MacBook Pro with an M1 Max chip. The function signatures and set of benchmarks have both changed across this range so I've
Results:
So that's 1.17x, 2.55x and 2.04x slowdowns for 3x3, 5x5 and 7x7 kernels on 500x500 grayscale images. Master now has benchmarks for 3x3, 5x5 and 7x7 images as standard, although with the image size reduced to 300x300, so these comparisons should be easier in future. |
@theotherphil could you push your modified |
This branch has the new benchmarks plus filter5x5 and filter7x7: https://github.com/image-rs/imageproc/tree/v0.25.0-branch |
I'll add some for RGB images too, in case the regressions are larger than than for grayscale. |
RGB:
Results:
The regressions are much larger for RGB images. |
0.25
Master
|
@ripytide are your Master benchmarks using a 300x300 image or 500x500? |
Whatever the |
Ah, so your master and 0.25 benchmarks aren’t comparing like for like as I confusingly switched from 500x500 to 300x300 images when I added the 5x5 and 7x7 filter benchmarks. |
After reverting the use of |
Benchmarks added. Created #664 to fix the performance issues with the current filter implementation. |
No description provided.
The text was updated successfully, but these errors were encountered: