Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-554

BlockInfo.ensureCapacity may get a speedup from System.arraycopy()

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.21.0
    • Fix Version/s: 0.23.1
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      BlockInfo.ensureCapacity() uses a for() loop to copy the old array data into the expanded array. System.arraycopy() is generally much faster for this, as it can do a bulk memory copy. There is also the typesafe Java6 Arrays.copyOf() to consider, though here it offers no tangible benefit.

        Attachments

        1. HDFS-554.txt
          0.9 kB
          Harsh J
        2. HDFS-554.txt
          0.9 kB
          Harsh J
        3. HDFS-554.patch
          0.9 kB
          Harsh J

          Activity

            People

            • Assignee:
              qwertymaniac Harsh J
              Reporter:
              stevel@apache.org Steve Loughran
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: