Hi! I recently wrote a quick test that does this: private static int test_f(int i) { return i * 42; }
... int z = 41; for(int i = 0; i < 10000; ++i) { z = z*42; } // this loop runs in X seconds for(int i = 0; i < 10000; ++i) { z = test_f(z); } // this loop runs in 10*X seconds The results of this tests imples test_f() is not being inlined, even though it really is a prime candidate for it. It should also be possible to do this inlining at compile time. There seems to be no option to control optimization level of the compiler in Eclipse, perhaps optimizations like these are left to the VM? Does the Dalvik VM do inlining of functions at all, or did it just decide to not inline this specific instance? Curious to hear a response from someone more familiar with the Dalvik VM than me. Best regards, Viktor Linder --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---