Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12733

Cache collections toArray() is inefficient

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 11.0.9.Final, 12.0.1.Final
    • Core, Streams
    • None
    • Undefined

      Cache collections do not implement toArray(), so they use the implementation from AbstractCloseableIteratorCollection, which calls first collection.size(), creates an array with the appropriate size, and then populates the array from the iterator.

      Calling stream().toArray() avoids the size() call, so they should also implement toArray() and use stream.toArray() internally.

              Unassigned Unassigned
              dberinde@redhat.com Dan Berindei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: