The program using the opencv lib which I build from source runs slower than that using

I got opencv android sdk and opencv source code from [opencv releases], and get from sdk, and build opencv lib from source code using command below (use android ndk):


sum up, I have two libs, one of them is from opencv_android_sdk(let’s name it as lib1), another one is a couple of libopencv_*.so which built from source code(let’s name it as lib2) .

in addition, I build opencv from source code because I want to enable opencl.

in my project, I use cv::UMat to implement may algorithm, when I switch lib1 to lib2, I found my program become much more slower.
So, my question is there are any difference between lib1 and lib2?

I’m not native English speaker, I apologize if my description is confusing and please let me know, I will explain more.

After few days research, I found that the problem is that TBB is not enabled in lib2, lib2 take pthreads as it’s Parallel framework and pthreads is slower than TBB( I don’t know why! ), I add the option “-DWITH-TBB=ON” into cmake options, finally, lib2 works as well as lib1.
In addition, I use the cmake command below: