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

New Releases have Performance Issues #834

Closed
janecek1980 opened this issue Jan 7, 2020 · 3 comments
Closed

New Releases have Performance Issues #834

janecek1980 opened this issue Jan 7, 2020 · 3 comments

Comments

@janecek1980
Copy link

Release 1.1.20191217 (both 32/64 bit on Windows 10) and newer causes significant performance drop.

My test performance decreased from 225Hz to 91Hz. Previous release 1.1.20191110 is still OK.

Profiling seems to point to the Mat<> constructor with shared data - looks like core_Mat_new8() function has been wrapped into BEGIN_WRAP/END_WRAP block, which translates into try/catch.

Are there any performance tests in the library to be sure that no other parts are affected? If the performance bottleneck is the try/catch in the native code, is it necessary to have it there given its (supposed) major overhead?

Thanks, J.

@janecek1980
Copy link
Author

So I found one thing which is most likely the problem - clearly this is missing the static modifier:

class Mat
{
        private readonly Dictionary<Type, int> dataDimensionMap = new Dictionary<Type, int>
        {... };
        
        private readonly Dictionary<Type, MatType[]> acceptableTypesMap = new Dictionary<Type, MatType[]>
        {...};
}

@shimat
Copy link
Owner

shimat commented Jan 7, 2020

Thanks. I will fix the second problem.

Are there any performance tests in the library to be sure that no other parts are affected?

No.

If the performance bottleneck is the try/catch in the native code, is it necessary to have it there given its (supposed) major overhead?

On Windows, BEGIN_WRAP and END_WRAP are not replaced with try/catch.
On Linux, I have no other way to solve #517 / #523.

@janecek1980
Copy link
Author

Ok, thanks. J.

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

2 participants