Thinking about this a bit more, it is troubling that adding a couple “if" statements can cause a 10% performance degradation. It occurred to me that the degradation might be focused on this line:
if (index == length) And if it was rewritten as if (index == _source.length) it would take 2 fewer getter fetches. Of course there is some risk with doing that, if someone subclassed ArrayList and overrode what the source getter or length getter does. Also, we should verify with the patch author that the performance numbers were done on a release player running a release build. Otherwise, the sheer number of lines executed getting the length could be a factor. -Alex On 2/20/15, 12:55 AM, "Alex Harui" <aha...@adobe.com> wrote: >Well, it looks like it can cause a 10% performance degradation for the >random access case. > >So, I don’t like it, but not enough to veto it. I don’t want to >discourage folks from sharing patches that optimize performance. Someday, >FlexJS will have a variety of IList-type implementations, some of which >are optimized for certain scenarios. The Flex SDK could as well. So >instead of just taking the patch, some volunteers could create a >AddItemFirstOrLastArrayList from this patch. Or just take the patch and >we’ll see if anyone notices. > >-Alex > >On 2/20/15, 12:27 AM, "piotrz" <piotrzarzyck...@gmail.com> wrote: > >>Hi Guys, >> >> >>What do you think about these patch ? It looks quite good. Could it break >>something ? >> >>https://issues.apache.org/jira/browse/FLEX-34759 >> >>Piotr >> >> >> >>----- >>Apache Flex PMC >>piotrzarzyck...@gmail.com >>-- >>View this message in context: >>http://apache-flex-development.2333347.n4.nabble.com/JIRA-FLEX-34759-Arra >>y >>List-performance-improvements-tp45186.html >>Sent from the Apache Flex Development mailing list archive at Nabble.com. >