Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is Java fast enough? (for fun benchmark)

807591Mar 31 2008 — edited Apr 19 2008
Hi folks,

This is just for fun...

Here is a C++ program

http://www.pastebin.ca/965243 (C++)

that does this: counts up the frequency of each word in a text file, the output would look something like this

http://www.pastebin.ca/965230

and time would be printed at the end (time counting doesn't include time to print the output)...

Just for fun, I wrote a java version to test the speed between two versions

http://www.pastebin.ca/965246 (java version).

The text file to be used is 3.9 meg bible.txt

http://www.cas.mcmaster.ca/~bill/strings/english/bible

but that file must be made larger into 10x bibles, making it into 40 meg, bible2.txt

The java version I wrote is already two times faster (I am sure C++ version can be improved), but I am interested to see a Java version that is faster than the one I have right now.

if someone has free time for this :)

The one that is fastest wins.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2008
Added on Mar 31 2008
58 comments
281 views