Wednesday, May 30, 2012

Re: [android-developers] Problem with hashing speed

On May 31, 2012, at 5:22 AM, jing yang wrote:

> Thanks for spending some time in doing the tests!
> but can you try including "byte[] f = md.digest();" inside your loop ?
> in my test phone, add the digest() method will increase the timing by
> 40%.

I'm seeing similar behavior, time increased roughly to 9564ms. But asking for a hash value every 16 bytes doesn't sound too much of a real life use scenario though.

> But since your timings are much faster.. i think it could be due to
> the dual core CPU of S2?
> wow but i never expected the diffences in timings to be so huge.
> do you happen to know any faster method of doing a hash?

I really do not know but the difference seems to be too huge to be explained with faster processor only. Anyway, it's SGS2 running on ICS 4.0.3 I'm running these tests on.

> On May 31, 1:32 am, Harri Smått <har...@gmail.com> wrote:
>> On May 30, 2012, at 6:16 PM, jing yang wrote:
>>
>>> I was testing the hash methods on a 16 bytes input, randomly generated
>>> with the SecureRandom class.
>>
>> I'm still getting far more faster speeds on SGS2, around 4871ms for 524288 iterations. Roughly half of the time is spent generating random bytes, half calculating hash. My test code as below;

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate