Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-20129

Restore optimization in MultiCBuilder around building one clustering

    XMLWordPrintableJSON

Details

    • Degradation - Performance Bug/Regression
    • Normal
    • Normal
    • Performance Regression Test
    • All
    • None
    • 5.1
    • Hide

      There should be no implications for correctness here. Once we pass the existing test suite, the main concern is that we avoid BTree builder and iterator creations in MultiCBuilder#build().

      Show
      There should be no implications for correctness here. Once we pass the existing test suite, the main concern is that we avoid BTree builder and iterator creations in MultiCBuilder#build() .

    Description

      Back in CASSANDRA-10409, we optimized the single clustering case for MultiCBuilder to produce less garbage. In CASSANDRA-19341, we de-facto removed that optimization, and I'm seeing increased allocations in trunk, specifically at least double the number of BTree builders. In the write-heavy workload I'm profiling, this jumps up to become the most common TLAB allocation. I'm attaching JFR screenshots from 4.1 and trunk that show the codepaths that touch this on both versions. We should consider reintroducing something like the old OneClusteringBuilder.

      I used WriteBench to explore things here, mostly w/ the TRUNCATE EndOp, and made sure commitlog writes, view updates, and CassandraTableWriteHandler tracing were disabled to reduce the noise.

      blerer

      Attachments

        1. 41 BTree builder inits.png
          1.39 MB
          Caleb Rackliffe
        2. trunk BTree builder inits.png
          1.78 MB
          Caleb Rackliffe
        3. 41 vs trunk GC.png
          3.15 MB
          Caleb Rackliffe
        4. 41 vs trunk TLAB allocations.png
          4.44 MB
          Caleb Rackliffe
        5. pre-patch-allocations.jfr
          2.19 MB
          Caleb Rackliffe
        6. post-patch-allocations-2.jfr
          2.21 MB
          Caleb Rackliffe
        7. ci_summary.html
          33 kB
          Caleb Rackliffe

        Issue Links

          Activity

            People

              maedhroz Caleb Rackliffe
              maedhroz Caleb Rackliffe
              Caleb Rackliffe
              Abe Ratnofsky, Benjamin Lerer, Bernardo Botella
              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 - 50m
                  50m