We have discovered a substantial performance drop in our Augmented Reality application when comparing a Nexus S running Ice Cream Sandwich (ICS) with one running Gingerbread.
As there are a lot of things going on in our application, we tried to create a very simple test application to see if we still see the problem. Most notably, we rely on the camera preview callbacks and a JNI interface which interfaces with native code that performs calculations on the image data. In the test application, we replaced the image analysis with a simple function that does some dummy calculations for a number of iterations and measures the amount of time it takes to finish. When comparing execution times on both Nexus S devices, we can see that the function takes substantially longer to execute once on the ICS device than on the Gingerbread device. When comparing method traces on this test project, we noticed a difference. On ICS we see lots of gaps in the execution of the native function call (i.e. in the JNI function call). On Gingerbread, these gaps are not present. We cannot explain why these gaps are there, since nothing else seems to be happening on other threads [that we can observe using traceview]. But they account for a large difference between the measured ‘excl real msec’ and ‘incl real msec’ on the ICS device. Note that our test application performs the native calculations inside the preview callback and therefore on the main thread, but the observed drop in performance is unchanged if we perform the calculations (i.e. image analysis) on another thread (no difference between: blocking or non-blocking; started from Java or native code). In our Augmented Reality application, the performance drop is even more significant, and we observe our native code processing taking between 100 and 200% longer than it does on a device running Gingerbread. We can also see the issue on the Galaxy Nexus, but do not have a Galaxy Nexus running Gingerbread to compare it with. On similar hardware (Samsung Galaxy S 2, Android 2.3.4), performance is unaffected and our application thus runs 2-3 times faster than on the Galaxy Nexus. Has anyone else seen this problem before or could provide insight into why this is happening or how to fix the issue, i.e. get rid of the drop in performance? Our test application can be obtained here (archive includes traceview files): http://bit.ly/xJfI7O Screenshots of the method traces showing the issue: Gingerbread: http://bit.ly/wSz9fr ICS: http://bit.ly/zwVkLB -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

