Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-23107

Avoid temp byte array creation when doing cacheDataOnWrite

    XMLWordPrintableJSON

    Details

    • Hadoop Flags:
      Reviewed

      Description

      code in HFileBlock.Writer.cloneUncompressedBufferWithHeader

      ByteBuffer cloneUncompressedBufferWithHeader() {
        expectState(State.BLOCK_READY);
        byte[] uncompressedBlockBytesWithHeader = baosInMemory.toByteArray();
        …
      }
      

      When cacheOnWrite feature enabled, a temp byte array was created in order to copy block’s data, we can avoid this by use of ByteBuffAllocator. This can improve GC performance in write heavy scenarios.

        Attachments

        1. flamegraph_after.svg
          273 kB
          chenxu
        2. flamegraph_before.svg
          240 kB
          chenxu

          Issue Links

            Activity

              People

              • Assignee:
                javaman_chen chenxu
                Reporter:
                javaman_chen chenxu
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: