Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-2445

Replace ToStringBuilder in BlockData

    XMLWordPrintableJSON

Details

    Description

      BlockData#toString uses ToStringBuilder for ease of implementation. This has a few problems:

      1. ToStringBuilder uses StringBuffer, which is synchronized
      2. the default buffer is 512 bytes, more than needed here
      3. BlockID and ContainerBlockID both use another StringBuilder or StringBuffer for their toString implementation, leading to several allocations and copies

      The flame graph shows that BlockData#toString may be responsible for 1.5% of total allocations while putting keys.

      Attachments

        1. blockdata.png
          396 kB
          Attila Doroszlai
        2. setchunks.png
          395 kB
          Attila Doroszlai

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m