Performance issue with Android arm64-v8a custom build [closed]
Hello,
I have successfully built OpenCV for Android using the c++_static STL and clang on an Ubuntu 16.04 machine. Functionality I have tested so far appears to be OK.
On armeabi-v7a, execution performance (as in time it takes to run inferences within the DNN module) matches the performance that I get if I use the official 3.4.1 Android libraries. However, when I build for arm64-v8a, performance of the custom build is about 3x slower than the official OpenCV Android libraries for the same ABI. I can't figure out what the variance (apart from c++_static) in my build configuration may be.
The only reason I'm running my own build is that I require a c++_static build due to other dependencies in my project which I'm unable to change.
If anyone is able to and willing to review and help, below is the CMAKE configuration that I'm using to build the arm64-v8a library. Why is my custom built library slower than the official OpenCV Android arm64-v8a release? What can I do to match performance?
ANDROID_ABI:STRING=arm64-v8a
ANDROID_ARM_NEON:BOOL=ON
//Build binaries of Android examples with native libraries
ANDROID_EXAMPLES_WITH_LIBS:BOOL=OFF
ANDROID_PLATFORM:STRING=android-25
ANDROID_STL:STRING=c++_static
//Build examples for Android platform
BUILD_ANDROID_EXAMPLES:BOOL=OFF
//Build Android projects providing .apk files
BUILD_ANDROID_PROJECTS:BOOL=OFF
//Build OpenCV Manager for Google Play
BUILD_ANDROID_SERVICE:BOOL=OFF
//Build CUDA modules stubs when no CUDA SDK
BUILD_CUDA_STUBS:BOOL=OFF
//Create build rules for OpenCV Documentation
BUILD_DOCS:BOOL=OFF
//Build all examples
BUILD_EXAMPLES:BOOL=OFF
//Build libjasper from source
BUILD_JASPER:BOOL=ON
//Enable Java support
BUILD_JAVA:BOOL=ON
//Build libjpeg from source
BUILD_JPEG:BOOL=ON
//Build only listed modules (comma-separated, e.g. 'videoio,dnn,ts')
BUILD_LIST:STRING=
//Build openexr from source
BUILD_OPENEXR:BOOL=ON
//Enables 'make package_source' command
BUILD_PACKAGE:BOOL=ON
//Build performance tests
BUILD_PERF_TESTS:BOOL=OFF
//Build libpng from source
BUILD_PNG:BOOL=OFF
//Force to build libprotobuf from sources
BUILD_PROTOBUF:BOOL=ON
//Build shared libraries (.dll/.so) instead of static ones (.lib/.a)
BUILD_SHARED_LIBS:BOOL=ON
//Download and build TBB from source
BUILD_TBB:BOOL=ON
//Build accuracy & regression tests
BUILD_TESTS:BOOL=OFF
//Build libtiff from source
BUILD_TIFF:BOOL=ON
//Use symlinks instead of files copying during build (and !!INSTALL!!)
BUILD_USE_SYMLINKS:BOOL=OFF
//Build WebP from source
BUILD_WEBP:BOOL=ON
//Include debug info into release binaries ('OFF' means default
// settings)
BUILD_WITH_DEBUG_INFO:BOOL=OFF
//Enables dynamic linking of IPP (only for standalone IPP)
BUILD_WITH_DYNAMIC_IPP:BOOL=OFF
//Build zlib from source
BUILD_ZLIB:BOOL=OFF
//Build utility applications (used for example to train classifiers)
BUILD_opencv_apps:BOOL=OFF
//Include opencv_calib3d module into the OpenCV build
BUILD_opencv_calib3d:BOOL=ON
//Include opencv_core module into the OpenCV build
BUILD_opencv_core:BOOL=ON
//Include opencv_dnn module into the OpenCV build
BUILD_opencv_dnn:BOOL=ON
//Include opencv_features2d module into the OpenCV build
BUILD_opencv_features2d:BOOL=ON
//Include opencv_flann module into the OpenCV build
BUILD_opencv_flann:BOOL=ON
//Include opencv_highgui module into the OpenCV build
BUILD_opencv_highgui:BOOL=ON
//Include opencv_imgcodecs module into the OpenCV build
BUILD_opencv_imgcodecs:BOOL=ON
//Include opencv_imgproc ...