Skip to content
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

Some functions in this library are slower than opencv4 5.5 #212

Open
SheepKeeper1990 opened this issue May 23, 2022 · 7 comments
Open

Some functions in this library are slower than opencv4 5.5 #212

SheepKeeper1990 opened this issue May 23, 2022 · 7 comments

Comments

@SheepKeeper1990
Copy link

Hi,
First of all, thank you for your contribution. But when I used this library, I tested Simd:: Resize(),Simd:: BgrToGray and so on. Some functions are 4-6 times slower than OpenCV4.5.5. (OS: Ubuntu18.04 CPU: i7-10750H 12cores)

Did I miss anything when I used it? Could you give a use case of image processing to make it faster than opencv's function. If most of them are slower than opencv, what are the advantages of this library.
Sincerely look forward to your answer.

@ermig1979
Copy link
Owner

Hi!
Thank you for response.
OpenCV uses all cpu cores by default.
Simd specializes on single-thread performance (for example when resize is used in many threads).

@SheepKeeper1990
Copy link
Author

Hi!
Thank you for response.
Does the SIMD library support multithreaded computing?Could you show me a simple example or pseudo code structure.
Thanks again.

@SheepKeeper1990
Copy link
Author

SheepKeeper1990 commented May 24, 2022

I tried to combine SIMD functions,such as Simd::ResizeBilinear() with OpenMP to achieve multi-core acceleration, but it didn't work. It takes 7.79ms to execute 10 times, while opencv4.5.5 is 0.73ms. How to improve this?
omp_set_num_threads(12);
#pragma omp parallel
{
Simd::ResizeBilinear(viewSrc, viewDst);
}

@ermig1979
Copy link
Owner

ermig1979 commented May 26, 2022

Hi!
Unfortunatily this does not work such way.
I have to rewrite code of implementation of `ResizeBilinear'.
I will add this issue into my future development plans.

@SheepKeeper1990
Copy link
Author

Thank you again for your contribution。

@MyronRodrigues-StreetDrone

Hi @ermig1979
Thank you for your contribution.

I have similar issues with debayering, its around 5 times slower than opencv debayering.
I'm new to this but from what I understand opencv is using all my cpu cores for debayering vs Simd library uses a single thread for the operation?
Any way if the above is true to increase performance or the library implementation has to change?

@theoractice
Copy link

For my use case (shrink small images to smaller ones), Simd:: Resize() works 3x faster when compared to opencv 4.8, So it depends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants