flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Labriola (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33341) VectorCollection becomes progressively slower
Date Mon, 07 Jan 2013 01:33:11 GMT

    [ https://issues.apache.org/jira/browse/FLEX-33341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13545570#comment-13545570
] 

Michael Labriola commented on FLEX-33341:
-----------------------------------------

The iterative slow down is IMO the test harness and not the VectorCollection. 

The confusion comes from the difference in these two collection types.

To have any sort of typed data (as we don't have generics in AS), you pass a Vector into the
VectorCollection to be used. The ArrayCollection makes its own Array. This means they are
on roughly equal ground for the first test.

However, in the test harness, the second to last test filters both of these collections down
to 1 item. Then calls removeAll(). A little known and interesting feature of ListCollectionView
is that removeAll() only removes the items currently in the view if the view is filtered...
meaning in both cases, 1 item is removed and leaves the other 49999.

When the test is run again, a new ArrayCollection (and hence a new Array) is created, but
the actual backing Vector to the VectorCollection is reused... and it still has nearly 50000
items in it.

---

Now, regarding the actual performance we might be able to squeeze some more out but here is
the core issue. VectorCollection needs to be a ListCollectionView extension in order to work
in all of the Flex components. ListCollectionView uses an Array internally for all its indexes
and then manages an IList, implemented by either an ArrayList or a VectorList. So, that is
the only part that really gets to be Vector versus Array. So, the things that would most benefit
from being a Vector (index and retrieval) aren't and the things that are least favorable to
use Vector are...

That is not to say that more can't be done, but the initial goal with VectorCollection was
to provide the ability to use existing Vectors that are accessed throughout the application
within Flex components. 

Unfortunately the way ListCollectionView interacts with IList it removes many of the benefits
of Vector. The real answer here IMO is to change ListCollectionView and places that reference
the implementation directly, to ensure we could remake VectorCollection without extending
ListCollectionView or to rework ListCollectionView to use Vectors internally. Then we would
see real performance benefits on both ArrayCollection and VectorCollection.

So, IMO, this is a performance issue that can be addressed with some architectural changes
but not a bug.

Mike

                
> VectorCollection becomes progressively slower
> ---------------------------------------------
>
>                 Key: FLEX-33341
>                 URL: https://issues.apache.org/jira/browse/FLEX-33341
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Collections
>    Affects Versions: Apache Flex 4.9.0
>         Environment: Flash Player 11.5
>            Reporter: Simon Gladman
>              Labels: VectorCollection
>             Fix For: Apache Flex 4.9.0
>
>
> If I repeatedly addItem() and removeAll() from a VectorCollection, the removeAll() and
refresh() methods become progressively slower.
> An example can be found here: http://flexmonkey.blogspot.co.uk/2013/01/apache-flex-490-vectorcollection-vs.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message