On Tue, Jun 9, 2009 at 2:40 PM, Gavin Aiken <[email protected]>wrote:

> Because, I'm very new to this :) Also I read this;
>
>
> http://developer.android.com/guide/practices/design/performance.html#prefer_static
>

ah, this is only for methods, it doesn't apply to variables and fields :-)


>
> If I have misinterpreted the meaning I'll go change the source. Anything
> else to make it fairer would be greatly appreciated.
>

yes, you should probably just use the same source than the Java benchmark.

Fairness is a very relative thing. For example you could try to inline all
the swaps in all benchmarks, and I guess you would see much less difference
between the VM and native tests. (Not to say that Dalvik won't be
significantly slower than native code, but there are several ways to
quantify that with increased accuracy).

Also, why is the second graph titled "Desktop platform" too? If you're
running this on the emulator, please keep in mind that it's probably a very
bad platform to base benchmark on (a real device would be much better).

And I can't help notice that the C code in the second graph seems to be 10x
slower than on the first, which is quite interesting. Do you have the specs
for each system used to run the tests?


> Gav
>
>
>
>
> On Tue, Jun 9, 2009 at 7:55 AM, David Turner <[email protected]> wrote:
>
>> Why are you using static class variables instead of locals in the Android
>> Quicksort example? They are considerably slower to access.
>>
>>
>> On Sun, Jun 7, 2009 at 1:04 PM, Gav <[email protected]> wrote:
>>
>>>
>>> Hi All,
>>>
>>> I have setup some basic tests to compare the runtime of algorithms on
>>> Dalvik Vs those run Natively on a G1.
>>>
>>> The tests can be found here;
>>>
>>> http://code.google.com/p/android-benchmarks/
>>>
>>> Go to 'source' and checkout with SVN.
>>>
>>> I wrote a brief tutorial on getting JNI to work although I'm sure
>>> there are better ones out there;
>>>
>>> http://gavaiken.blogspot.com/
>>>
>>> There are a bunch of links at the bottom of this page for those that
>>> are interested in trying JNI;
>>>
>>> http://www.android-internals.org/index.php?title=Main_Page
>>>
>>> Although officially it's not supported there is an NDK planned for the
>>> near future (End of 2009);
>>>
>>> http://groups.google.com/group/android-ndk
>>>
>>> My preliminary results show that quick sort is vastly slower than
>>> native code on the G1 whereas the Sun JVM versus native code (gcc -O2)
>>> are essentially the same on a desktop.
>>>
>>> I'm not saying it's groundbreaking info but it's nice to have some
>>> hard statistics. You'll have to change the output log file names to
>>> run this and have the Code Sourcery compiler installed.
>>>
>>> Cheers,
>>>
>>> Gav
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" 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-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to