Dan Berindei created ISPN-12733:
-----------------------------------
Summary: Cache collections toArray() is inefficient
Key: ISPN-12733
URL:
https://issues.redhat.com/browse/ISPN-12733
Project: Infinispan
Issue Type: Bug
Components: Core, Streams
Affects Versions: 12.0.1.Final, 11.0.9.Final
Reporter: Dan Berindei
Fix For: 12.1.0.Final
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.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)