Is Java fast enough? (for fun benchmark)
807591Mar 31 2008 — edited Apr 19 2008Hi 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.