Erratic execution speed of developed Native camera based App on Android Studio 2.2.1

39 views
Skip to first unread message

Harash Sharma

unread,
Oct 19, 2016, 11:03:58 AM10/19/16
to android-ndk
Hi all,

 I am developing a Camera based Native App for Image Processing. The Images are captured from the camera, passed on to OpenCV based C++ processing modules. The processed image is displayed. The  processing (C++) approximately takes 20-30 ms. However I have observed a frequent anomaly with Android Studio compilation (both 2.1.2 and 2.2.1). Sometimes the generated APK takes unusually long, almost 10-15 times, execution time( order of 300ms). Once this happens, all subsequent rebuilds demonstrate the same behavior. If I close Android Studio, reboot my PC and retry building the App, normal execution time is observed. 

The Software Configuration is --
OS:Windows 10 Pro x64
Build: Android Studio 2.2.1
NDK-R12
OpenCV3.1

Thanks in Advance

Harash

Steven Winston

unread,
Oct 20, 2016, 8:24:05 PM10/20/16
to android-ndk
I'd recommend giving it more memory.  There's a number of ways to speed up compile execution time.  300ms isn't long enough to warrant spending a lot of time trying to make it faster, and likely the time it takes is really in the gradle configuration stage so things like ccache and distcc wouldn't help much.   So quick fix ideas like giving more memory to the JVM and gradle daemon is probably best solution.

This doc should get you going on the right path: https://developer.android.com/studio/intro/studio-config.html
Reply all
Reply to author
Forward
0 new messages