Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-2827

HeapIterator optimization

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5.1, 1.6.0
    • 1.5.2, 1.6.1, 1.7.0
    • None
    • None

    Description

      We've been running a few performance tests of our iterator stack and noticed a decent amount of time spent in the HeapIterator specifically related to add/removal into the heap.

      This may not be a general enough optimization but we thought we'd see what people thought. Our assumption is that it's more probable that the current "top iterator" will supply the next value in the iteration than not. The current implementation takes the other assumption by always removing + inserting the minimum iterator back into the heap. With the implementation of a binary heap that we're using, this can get costly if our assumption is wrong because we pay the log penalty of percolating up the iterator in the heap upon insertion and again when percolating down upon removal.

      We believe our assumption is a fair one to hold given that as major compactions create a log distribution of file sizes, it's likely that we may see a long chain of consecutive entries coming from 1 iterator. Understandably, taking this assumption comes at an additional cost in the case that we're wrong. Therefore, we've run a few benchmarking tests to see how much of a cost we pay as well as what kind of benefit we see. I've attached a potential patch (which includes a test harness) + image that captures the results of our tests. The x-axis represents # of repeated keys before switching to another iterator. The y-axis represents iteration time. The sets of blue + red lines varies in # of iterators present in the heap.

      Attachments

        1. ACCUMULO-2827.0.patch.txt
          9 kB
          Jonathan Park
        2. new_heapiter.png
          37 kB
          Jonathan Park
        3. old_heapiter.png
          35 kB
          Jonathan Park
        4. together.png
          153 kB
          Jonathan Park
        5. accumulo-2827.raw_data
          2 kB
          Jonathan Park
        6. ACCUMULO-2827-compaction-performance-test.patch
          3 kB
          Keith Turner
        7. ACCUMULO-2827.1.patch.txt
          9 kB
          Jonathan Park
        8. ACCUMULO-2827.2.patch.txt
          9 kB
          Jonathan Park
        9. ACCUMULO-2827.3.patch.txt
          5 kB
          Jonathan Park
        10. BenchmarkMultiIterator.java
          4 kB
          Jonathan Park
        11. ACCUMULO-2827-compaction-performance-test.patch.2
          5 kB
          Jonathan Park

        Issue Links

          Activity

            People

              parkjsung Jonathan Park
              parkjsung Jonathan Park
              Votes:
              0 Vote for this issue
              Watchers:
              8 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