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

Get-by-index introduced in CASSANDRA-15394 could have negative performance impact on non-RandomAccess List

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • Legacy/Core
    • None
    • Performance
    • Normal
    • All
    • None

    Description

      CASSANDRA-15394 replaced the iterator based iteration with the get-by-index one to avoid allocation iterators.
      It works for the lists that support RandomAccess, i.e. the big O of get() is O(1).
      However, it fails when the list does not support RandomAccess. The get() method's time complexity can be linear, and it leads to O(n^2) for the overall iteration.
      The implementation should provide different behaviors based on the property.

      Attachments

        Activity

          People

            yifanc Yifan Cai
            yifanc Yifan Cai
            Yifan Cai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: