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

Cache collections toArray() is inefficient

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • 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)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: