Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6359820

arraycopy slower on 32-bit amd64 -server than -client on some array sizes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 6
    • hotspot
    • None
    • generic
    • generic

      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

            neliasso Nils Eliasson (Inactive)
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: