Hi dm1973, Actually these tests are not useless. Of course good modern compilers should optimize away the code above. The reality is that the Android compiler is not a good compiler so it does not optimize the above code. This allows the simple example above to show the performance limitations of the Dalvik compiler.
The point of my sample code above is to quickly show the Dalvik vs C performance without showing all the extraneous supporting code for running the test. It's easy enough to subtly change the example posted above so it doesn't get optimized away though even by a good compiler. I.e. simply return the value from the method above and post it to a text field in Android or log it in in C. I actually ran the tests that way (where the processing is not optimized away) to get the results that I posted above.
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en