Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10616 Improve performance of path handling
  3. HDFS-10656

Optimize conversion of byte arrays back to path string

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 2.7.4, 3.0.0-alpha1
    • hdfs
    • None
    • Reviewed

    Description

      DFSUtil.byteArray2PathString generates excessive object allocation.

      1. each byte array is encoded to a string (copy)
      2. string appended to a builder which extracts the chars from the intermediate string (copy) and adds to its own char array
      3. builder's char array is re-alloced if over 16 chars (copy)
      4. builder's toString creates another string (copy)

      Instead of allocating all these objects and performing multiple byte/char encoding/decoding conversions, the byte array can be built in-place with a single final conversion to a string.

      Attachments

        1. HDFS-10656.patch
          3 kB
          Daryn Sharp

        Issue Links

          Activity

            People

              daryn Daryn Sharp
              daryn Daryn Sharp
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: