When using System.arraycopy or Arrays.copyOf to copy arrays of some sizes,
-client outperforms -server by about 10% on 32-bit amd64 platforms.
Array copying is really fast, and server loses by only 10%, and only
on some array sizes, so this is really not a big deal, perhaps just
bad luck, but it is possible that there is some more performance
to be squeezed here. If there are tuning values used internally
by the array copy assembly code, it is possible it could be
better tuned.
Using zsh and my benchmark program
ArrayCopyMicroBenchmark.java, available in /home/mb29450/src/toy or
as attachment, I used a command like this:
(mb29450@bonsai) ~/src/toy $ (pwd; uname -a; /java/jdk/bin/jver 6.0 javac ArrayCopyMicroBenchmark.java && for (( j=10; j < 2000; j=(((j*107)/100)+1) )); do uptime; for f in -client -server; do iterations=`expr 10000000 / $j`; size=`expr 28 \* $j`; echo $f iterations=$iterations size=$size; time /java/re/jdk/6.0/promoted/latest/binaries/solaris-amd64/bin/java $f -XX:MaxHeapSize=536755200 -XX:+UseParallelGC ArrayCopyMicroBenchmark $iterations $size; done; done)
to get results like this:
-client iterations=208333 size=1344
Method Millis Ratio
arraycopy 897 1.000
copyOf 889 0.992
clone 1140 1.271
loop 3205 3.572
-server iterations=208333 size=1344
Method Millis Ratio
arraycopy 1060 1.000
copyOf 1066 1.006
clone 1061 1.001
loop 2989 2.820