Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > greatly differing processing time between java and Linux while calculating hashes?

Reply
Thread Tools

greatly differing processing time between java and Linux while calculating hashes?

 
 
qwertmonkey@syberianoutpost.ru
Guest
Posts: n/a
 
      09-10-2012
> As far as I could extract from that code (which I find pretty badly
readable btw.) you are measuring digest calculation and IO.
~
Well, if I understand you, you will have to read in the file you are
checksumming anyway, right?
~
I used FileInputStream's read(byte[]) method in a straight forward way,
which is, byte[], what you must feed a MessageDigest's update method. So,
what do you mean?
~
> What measures did you take to ensure there are no effects from OS buffering?

~
What do you mean? What extra measure should I take to ensure there are no
effects from OS buffering?
~
> Also, why are you comparing apples (Java) and oranges (Linux) - at
> least in the subject?

~
Because I am trying to extract sugar from them in the most efficient way
~
> Are you aware that the JVM has some startup time
> which can be significant when measuring run once applications?

~
Yes, and this is why I am just timing the method call and testing different
block sizes for the buffer ...
~
Still guys (to me) a difference of more than 25% in processing time is
significant and I don't think that what you consider to be my odd style to code
is causing it
~
lbrtchx
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-13-2012
On Mon, 10 Sep 2012 01:45:36 +0000 (UTC),
wrote, quoted or indirectly quoted
someone who said :

>~
> Well, if I understand you, you will have to read in the file you are
>checksumming anyway, right?


You want in both cases to read it into RAM, then start your clock,
then do your computation, then stop your clock, so that you measuring
the difference in computation, not i/o.

JVMs take a while to get warmed up. When doing benchmarks you want to
run a few laps before you turn on the clock.
--
Roedy Green Canadian Mind Products http://mindprod.com
The iPhone 5 is a low end Rolex.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
greatly differing processing time between java and Linux while calculating hashes? qwertmonkey@syberianoutpost.ru Java 5 09-09-2012 08:35 PM
greatly differing processing time between java and Linux while calculating hashes? qwertmonkey@syberianoutpost.ru Java 0 09-09-2012 02:35 PM
greatly differing processing time between java and Linux while calculating hashes? qwertmonkey@syberianoutpost.ru Java 1 09-09-2012 09:38 AM
Calculating time between two date objects Brian Java 4 12-10-2007 11:42 AM
Question regarding linking and moving - any advice greatly appreciated Kirok Java 2 11-10-2005 02:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57