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

Cache collections toArray() is inefficient

    XMLWordPrintable

Details

    • Bug
    • Status: New (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 11.0.9.Final, 12.0.1.Final
    • 12.1.12.Final
    • Core, Streams
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: