[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
Just following up to my initial post, I have implemented the above look in native code using Android's SDK. The native code performs in a few milliseconds as hoped. This goes to confirm that for compute intensive tasks, Dalvik can be hundreds of times slower than native. Hi, Can you provide me with your Java test code? I just finished porting TotalCross to Android and i would like to know how fast is my virtual machine comparing with Dalvik's. And your program could be a good start. You can send me it privately. cheers guich http://www.totalcross.com -- 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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
The Android 2.1 SDK is out, but - at least from a first test on the emulator that comes with the SDK - it does not look like the Dalvik JIT has been activated :-(. On 7 Jan., 17:55, Biosopher biosop...@gmail.com wrote: The Dalvik JIT appears to result in a 1.7x improvement when run on an armv7. Here's the post from the Android team:http://groups.google.com/group/android-platform/browse_thread/thread/... The Android team's independent benchmark results are here (done by 0xlab):http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef... -- 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
Re: [android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
I was under the impression that was coming with Flan. 2.1 is still Eclair. S --- Sena Gbeckor-Kove CTO/Founder - imKon UK : +44 7788 146652 NL : +31 62 434 1290 s...@imkon.com|www.imkon.com Asia (Singapore) : 35 Selegie Road, #09-14/15 Parklane Shopping Mall, 188307 Singapore, Singapore Europe (London) : 145-157 St John's St, EC1V 4PY London, UK On 12 Jan 2010, at 10:13, Ecthelion wrote: The Android 2.1 SDK is out, but - at least from a first test on the emulator that comes with the SDK - it does not look like the Dalvik JIT has been activated :-(. On 7 Jan., 17:55, Biosopher biosop...@gmail.com wrote: The Dalvik JIT appears to result in a 1.7x improvement when run on an armv7. Here's the post from the Android team:http://groups.google.com/group/android-platform/browse_thread/thread/... The Android team's independent benchmark results are here (done by 0xlab):http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef... -- 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 smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
On Jan 7, 9:06 am, Biosopher biosop...@gmail.com wrote: Just following up to my initial post, I have implemented the above look in native code using Android's SDK. The native code performs in a few milliseconds as hoped. This goes to confirm that for compute intensive tasks, Dalvik can be hundreds of times slower than native. As I noted over on android-ndk, function inlining and strength- reduction can turn let's call an empty function 2 million times into let's set an integer to 2 million... oh, we don't use the result, so let's do nothing at all. Hundreds of times slower is easily achievable with specific constructs. -- 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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
On Jan 7, 8:55 am, Biosopher biosop...@gmail.com wrote: The Dalvik JIT appears to result in a 1.7x improvement when run on an armv7. That's a stale prototype. Quoting from the link you included, an old snapshot of what we consider a promising proof-of-concept. The Android team's independent benchmark results are here (done by 0xlab):http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef... 0xlab != the Android team. (They do nice work though.) -- 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
Re: [android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
So, any news of the official Android version? Cheers S --- Sena Gbeckor-Kove CTO/Founder - imKon UK : +44 7788 146652 NL : +31 62 434 1290 s...@imkon.com|www.imkon.com Asia (Singapore) : 35 Selegie Road, #09-14/15 Parklane Shopping Mall, 188307 Singapore, Singapore Europe (London) : 145-157 St John's St, EC1V 4PY London, UK On 12 Jan 2010, at 23:28, fadden wrote: On Jan 7, 8:55 am, Biosopher biosop...@gmail.com wrote: The Dalvik JIT appears to result in a 1.7x improvement when run on an armv7. That's a stale prototype. Quoting from the link you included, an old snapshot of what we consider a promising proof-of-concept. The Android team's independent benchmark results are here (done by 0xlab):http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef... 0xlab != the Android team. (They do nice work though.) -- 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 smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
The Dalvik JIT appears to result in a 1.7x improvement when run on an armv7. Here's the post from the Android team: http://groups.google.com/group/android-platform/browse_thread/thread/331d5f5636f5f532/dee6e0a81ae72264?#dee6e0a81ae72264 The Android team's independent benchmark results are here (done by 0xlab): http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef26f4e5b7427 -- 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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
Just following up to my initial post, I have implemented the above look in native code using Android's SDK. The native code performs in a few milliseconds as hoped. This goes to confirm that for compute intensive tasks, Dalvik can be hundreds of times slower than native. -- 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
Re: [android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
Fyi, there is no Dalvik or Android compiler; the Java code is just compiled with the regular javac. On Thu, Jan 7, 2010 at 9:03 AM, Biosopher biosop...@gmail.com wrote: 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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
Re: [android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
Flan not 2.1 which is still Eclair. S --- Sena Gbeckor-Kove CTO/Founder - imKon UK : +44 7788 146652 NL : +31 62 434 1290 s...@imkon.com|www.imkon.com Asia (Singapore) : 35 Selegie Road, #09-14/15 Parklane Shopping Mall, 188307 Singapore, Singapore Europe (London) : 145-157 St John's St, EC1V 4PY London, UK On 6 Jan 2010, at 20:39, Ecthelion wrote: Do you have any references for the statement below? And does next sdk release refer to the Android 2.1 SDK? Thanks On 6 Jan., 19:49, Fred Grott(Android Expert, http://mobilebytes.wordpress.com) fred.gr...@gmail.com wrote: the next sdk release is suppose to have a Dalvik JIT i nit doubling speed/performance.. -- 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 smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
You'll have to use the NDK and write some native C code to do your math, that will speed it up a lot. And use fixed point if you need floats. -niko On Jan 6, 11:08 am, Biosopher biosop...@gmail.com wrote: I'm writing a processing intensive digital sound processing app (requires numerous (50,000) Fast Fourier Transforms - FFT). This challenge led me to perform basic performance tests of Android running on an HTC Hero. The results show the Dalvik VM to be 20 times slower than a modern JIT-enabled JVM running J2ME and 25-50 times slower than a C program performing the same operations on a similarly powered mobile phone. For example, this simple iteration over an empty method 2 million times takes 1.4 seconds even though it doesn’t do anything. The same iteration is performed in milliseconds by a C program and about 100ms on a modern JVM public void performanceTest1() { for (int i = 0; i 200; i++) { emptyMethod(); } } private int emptyMethod() { return 0; } Doing something a little more complex like calculating the imaginary component of a complex conjugate 2 million times takes 3.2 seconds. Again, this takes milliseconds on other mobile phones running J2ME or C. public void performanceTest2() { for (int i = 0; i 200; i++) { int a = 5; int b = 5; int c = 5; int x = 5; int y = 5; y = ((a 16) * ((c 16) 16)) + (((a 0X) * ((c 16) 16)) 16); y = -y; y += ((b 16) * (c 16)) + (((b 0X) * (c 16)) 16); } } Has anyone else been able to overcome these performance issues of Android? -- 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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
Thanks Niko, I've been researching the NDK and am about to run the same performance tests there as well. I really didn't want to add the additional complexity of the NDK but seems that might be the only solution. I found a blog documenting the same performance issues so it appears my own findings aren't completely whacked: http://occipital.com/blog/2008/10/31/android-performance-2-loop-speed-and-the-dalvik-vm/ Cheers, Anthony -- 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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
the next sdk release is suppose to have a Dalvik JIT i nit doubling speed/performance.. I am in the same boat, have image processing projects but am holding off until JIT is out.. On Jan 6, 11:49 am, niko20 nikolatesl...@yahoo.com wrote: You'll have to use the NDK and write some native C code to do your math, that will speed it up a lot. And use fixed point if you need floats. -niko On Jan 6, 11:08 am, Biosopher biosop...@gmail.com wrote: I'm writing a processing intensive digital sound processing app (requires numerous (50,000) Fast Fourier Transforms - FFT). This challenge led me to perform basic performance tests of Android running on an HTC Hero. The results show the Dalvik VM to be 20 times slower than a modern JIT-enabled JVM running J2ME and 25-50 times slower than a C program performing the same operations on a similarly powered mobile phone. For example, this simple iteration over an empty method 2 million times takes 1.4 seconds even though it doesn’t do anything. The same iteration is performed in milliseconds by a C program and about 100ms on a modern JVM public void performanceTest1() { for (int i = 0; i 200; i++) { emptyMethod(); } } private int emptyMethod() { return 0; } Doing something a little more complex like calculating the imaginary component of a complex conjugate 2 million times takes 3.2 seconds. Again, this takes milliseconds on other mobile phones running J2ME or C. public void performanceTest2() { for (int i = 0; i 200; i++) { int a = 5; int b = 5; int c = 5; int x = 5; int y = 5; y = ((a 16) * ((c 16) 16)) + (((a 0X) * ((c 16) 16)) 16); y = -y; y += ((b 16) * (c 16)) + (((b 0X) * (c 16)) 16); } } Has anyone else been able to overcome these performance issues of Android? -- 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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
Do you have any references for the statement below? And does next sdk release refer to the Android 2.1 SDK? Thanks On 6 Jan., 19:49, Fred Grott(Android Expert, http://mobilebytes.wordpress.com) fred.gr...@gmail.com wrote: the next sdk release is suppose to have a Dalvik JIT i nit doubling speed/performance.. -- 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
[android-developers] Re: Performance issue: Dalvik VM is 20x slower than most modern Java VMs
Your tests are pretty useless. Most modern compilers will optimize away all of that code so what you are measuring is the overhead of your timing code. That being said interpreted byte code is slow. Either write native code where it matters or wait for JIT. On Jan 6, 9:08 am, Biosopher biosop...@gmail.com wrote: I'm writing a processing intensive digital sound processing app (requires numerous (50,000) Fast Fourier Transforms - FFT). This challenge led me to perform basic performance tests of Android running on an HTC Hero. The results show the Dalvik VM to be 20 times slower than a modern JIT-enabled JVM running J2ME and 25-50 times slower than a C program performing the same operations on a similarly powered mobile phone. For example, this simple iteration over an empty method 2 million times takes 1.4 seconds even though it doesn’t do anything. The same iteration is performed in milliseconds by a C program and about 100ms on a modern JVM public void performanceTest1() { for (int i = 0; i 200; i++) { emptyMethod(); } } private int emptyMethod() { return 0; } Doing something a little more complex like calculating the imaginary component of a complex conjugate 2 million times takes 3.2 seconds. Again, this takes milliseconds on other mobile phones running J2ME or C. public void performanceTest2() { for (int i = 0; i 200; i++) { int a = 5; int b = 5; int c = 5; int x = 5; int y = 5; y = ((a 16) * ((c 16) 16)) + (((a 0X) * ((c 16) 16)) 16); y = -y; y += ((b 16) * (c 16)) + (((b 0X) * (c 16)) 16); } } Has anyone else been able to overcome these performance issues of Android? -- 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