From: Isaac Gouy Date: 2006-08-05T12:00:16+09:00 Subject: Re: For performance, fix the Java program Jon Harrop wrote: -snip- > These languages are not the same. However, using "ordinary" IO via > System.out.println or cout or print_endline is the "vanilla" way of > outputting in all of these languages. Of these languages, only Java gives > appalling performance unless you switch to buffers. I guess you'd fail a Java exam :-) (I'm not interested enough to find out, but I suspect stdout is at minimum line-buffered.) > Even when you do use buffers in Java, it is still slower than unbuffered > C++, OCaml etc. on my machine. No where near an order of magnitude slower - iirc you reported 1.85x C > I was using Sun's J2SE 1.5. I also tried GNU's GIJ, which is even slower > than OCaml's bytecode. You failed the Java exam again :-) For Java without JIT use the -Xint command line option with the Sun JVM like this time java -Xint Latin > /dev/null And if the program ran for any amount of time we of course be using time java -server Latin > /dev/null