C# beats Java in 9 out of 10 benchmarks (benchmarks game)
benchmarksgame-team.pages.debian.net
benchmarksgame-team.pages.debian.net
Anyway, the original version spends half of it's time writing to stdout, verify by replacing
OutputStream stream = new BufferedOutputStream(System.out);
with OutputStream stream = new BufferedOutputStream(new FileOutputStream("./mandel_out"));
The time can be cut in half again by not using AtomicInteger (it is heavily contended) and having every thread operate on it's own chunk of the out array without any synchronization.https://salsa.debian.org/benchmarksgame-team/benchmarksgame/...
rtm "with output redirected to /dev/null" !
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
> new BufferedOutputStream(System.out);
$ time /opt/src/jdk-10.0.1/bin/java mandelbrot 16000 > /dev/null
real 0m7.144s
user 0m27.405s
sys 0m0.156s
> new FileOutputStream("./mandel_out") $ time /opt/src/jdk-10.0.1/bin/java mandelbrot 16000
real 0m7.125s
user 0m27.367s
sys 0m0.184s COMMAND LINE:
/opt/src/jdk-10.0.1/bin/java mandelbrot 16000"2. If the program gives the expected output within an arbitrary cutoff time (120 seconds) the program is measured again (5 more times) with output redirected to /dev/null."
"1. Each program is run and measured at the smallest input value, program output redirected to a file and compared to expected output. As long as the output matches expected output, the program is then run and measured at the next larger input value until measurements have been made at every input value."
The measurements are not made by typing each program command line into a terminal window.
rtm
"Each program is run as a child-process of a Python script using Popen…"
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...