This seems a bit surprising. In my experience well-written Java is
generally just about as fast as C++, especially for I/O bound work. The
exceptions are:
- java startup is still slow. This shouldn't matter much here because you
are using streaming anyway so you have java startup + C startup.
- java memory use is larger than a perfectly written C++ program and
probably always will be. Of course, getting that perfectly written C++
program is pretty difficult.
If the program in question is the one you posted earlier, it is very hard to
imagine that java would not saturate the I/O channels. Can you confirm that
you are literally doing:
for (node : line.split(" ")) {
out.collect(node, key);
}
And finding a serious difference in speed?
On 3/31/08 3:23 PM, "lin" <[EMAIL PROTECTED]> wrote:
> Java seems to be too slow. I rewrote the
> first program in Java and it runs 4 to 5 times slower than the C++ one.