[ https://issues.apache.org/jira/browse/IGNITE-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15075276#comment-15075276 ]
Andrey Kornev commented on IGNITE-2263: --------------------------------------- Sergi, you claims of efficiency or inefficiency are based on some unstated (or half-stated) assumptions. I must've misunderstood the code you had proposed as a replacement for collection views. For example, it's not clear to me what isAlwaysFalse() method does. Besides you efficiency claim is based on size of the source collection. How "huge" is "huge"? Does one always have to check the size before deciding whether to use a view or create a copy? Also, on the contrary, filtered iteration over a collection (regardless of its size) is the sweet spot of collection views, as is on-the-fly collection transformation. Finally, while talking about an expected performance benefits of a particular change one has to take into account all consequences, including the potential impact on GC. Personally, if I had to choose, I'd always go for less GC and the collection view is definitely a win in this context. One more point. isEmpty() can usually be short-circuited by returning as soon as the filter passes. Also, contains() can be made constant time in special cases, when the source collection implements Set (otherwise, contains() is always linear time with or without views). I'd also recommend dropping GridView class altogether and switching to Guava (in those few cases where the use of the collection views is warranted). Guava does excellent job by catching all special cases and making the views extremely performant. > Get rid of wrapping views where possible. > ----------------------------------------- > > Key: IGNITE-2263 > URL: https://issues.apache.org/jira/browse/IGNITE-2263 > Project: Ignite > Issue Type: Sub-task > Components: general > Affects Versions: ignite-1.4 > Reporter: Vladimir Ozerov > Assignee: Vladimir Ozerov > Priority: Critical > Fix For: 1.6 > > > We have about ~50-100 usages of things like F.view or F.viewReadOnly. In lots > cases it is not necessary, adds garbage, but doesn't add any value. > Need to revisit these places. -- This message was sent by Atlassian JIRA (v6.3.4#6332)