Details

    • Type: Sub-task
    • Status: Review In Progress
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: 4.0
    • Component/s: Local/Compaction
    • Labels:
      None
    • Change Category:
      Performance
    • Complexity:
      Normal
    • Platform:
      All
    • Impacts:
      None
    • Test and Documentation Plan:
      Hide

      circle

      Show
      circle

      Description

      Allocations of BTree iterators contribute a lot amount of garbage to the compaction and read paths.

      This patch removes most btree iterator allocations on hot paths by:
      • using Row#apply where appropriate on frequently called methods (Row#digest, Row#validateData
      • adding BTree accumulate method. Like the apply method, this method walks the btree with a function that takes and returns a long argument, this eliminates iterator allocations without adding helper object allocations (BTreeRow#hasComplex, BTreeRow#hasInvalidDeletions, BTreeRow#dataSize, BTreeRow#unsharedHeapSizeExcludingData, Rows#collectStats, UnfilteredSerializer#serializedRowBodySize) as well as eliminating the allocation of helper objects in places where apply was used previously^[1]^.
      • Create map of columns in SerializationHeader, this lets us avoid allocating a btree search iterator for each row we serialize.

      These optimizations reduce garbage created during compaction by up to 13.5%

       

      [1] the memory test does measure memory allocated by lambdas capturing objects

        Attachments

          Activity

            People

            • Assignee:
              bdeggleston Blake Eggleston
              Reporter:
              bdeggleston Blake Eggleston
              Authors:
              Blake Eggleston
              Reviewers:
              Benedict Elliott Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: