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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.21.0
    • 0.23.1
    • namenode
    • None
    • 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.patch
          0.9 kB
          Harsh J
        2. HDFS-554.txt
          0.9 kB
          Harsh J
        3. HDFS-554.txt
          0.9 kB
          Harsh J

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: