<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Populate a Flex&#8217;s ArrayCollection&#8230; a consideration about addItem() performance</title>
	<atom:link href="http://www.daveoncode.com/2009/01/12/populate-a-flexs-arraycollection-a-consideration-about-additem-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daveoncode.com/2009/01/12/populate-a-flexs-arraycollection-a-consideration-about-additem-performance/</link>
	<description>Objective C, iOS and more programming stuff</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:32:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: rafal</title>
		<link>http://www.daveoncode.com/2009/01/12/populate-a-flexs-arraycollection-a-consideration-about-additem-performance/comment-page-1/#comment-17951</link>
		<dc:creator>rafal</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:52:41 +0000</pubDate>
		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=216#comment-17951</guid>
		<description>Great post, thats what I needed. ~350% performance gain :)</description>
		<content:encoded><![CDATA[<p>Great post, thats what I needed. ~350% performance gain :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Test</title>
		<link>http://www.daveoncode.com/2009/01/12/populate-a-flexs-arraycollection-a-consideration-about-additem-performance/comment-page-1/#comment-10960</link>
		<dc:creator>Test</dc:creator>
		<pubDate>Wed, 22 Sep 2010 11:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=216#comment-10960</guid>
		<description>&lt;blockquote&gt;
&lt;a href=&quot;#comment-21&quot; rel=&quot;nofollow&quot;&gt;
&lt;strong&gt;&lt;em&gt;Davide Zanotti:&lt;/em&gt;&lt;/strong&gt;
&lt;/a&gt;
 Sure, I’m not a guru, but you can do the following:
1) Initialize an ArrayCollection and then use addItem():
var collection:ArrayCollection = new ArrayCollection();
collection.addItem(MyItem);
2) Initialize an ArrayCollection and then access its source (which is an array):
var collection:ArrayCollection = new ArrayCollection();
collection.source.push(MyItem2);
3) Passing directly an array to the constructor:
var collection:ArrayCollection = new ArrayCollection([&quot;foo&quot;, &quot;foo2&quot;, &quot;foo3&quot;]);
This technique is the fastest ;)
&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<blockquote><p>
<a href="#comment-21" rel="nofollow"><br />
<strong><em>Davide Zanotti:</em></strong><br />
</a><br />
 Sure, I’m not a guru, but you can do the following:<br />
1) Initialize an ArrayCollection and then use addItem():<br />
var collection:ArrayCollection = new ArrayCollection();<br />
collection.addItem(MyItem);<br />
2) Initialize an ArrayCollection and then access its source (which is an array):<br />
var collection:ArrayCollection = new ArrayCollection();<br />
collection.source.push(MyItem2);<br />
3) Passing directly an array to the constructor:<br />
var collection:ArrayCollection = new ArrayCollection(["foo", "foo2", "foo3"]);<br />
This technique is the fastest ;)
</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grafton Kennedy</title>
		<link>http://www.daveoncode.com/2009/01/12/populate-a-flexs-arraycollection-a-consideration-about-additem-performance/comment-page-1/#comment-5710</link>
		<dc:creator>Grafton Kennedy</dc:creator>
		<pubDate>Tue, 20 Apr 2010 14:19:34 +0000</pubDate>
		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=216#comment-5710</guid>
		<description>It&#039;s my understanding that ArrayCollection dispatches events for updates whereas Array does not.  Can somebody correct me if I&#039;m wrong?</description>
		<content:encoded><![CDATA[<p>It&#8217;s my understanding that ArrayCollection dispatches events for updates whereas Array does not.  Can somebody correct me if I&#8217;m wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://www.daveoncode.com/2009/01/12/populate-a-flexs-arraycollection-a-consideration-about-additem-performance/comment-page-1/#comment-3328</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sun, 18 Oct 2009 15:55:06 +0000</pubDate>
		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=216#comment-3328</guid>
		<description>This is a great tid-bit. Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>This is a great tid-bit. Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R_Bob776</title>
		<link>http://www.daveoncode.com/2009/01/12/populate-a-flexs-arraycollection-a-consideration-about-additem-performance/comment-page-1/#comment-1569</link>
		<dc:creator>R_Bob776</dc:creator>
		<pubDate>Fri, 15 May 2009 01:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=216#comment-1569</guid>
		<description>Nice solutions (I just used your array-randomize routine), but I&#039;ve a comment on ArrayCollection:  whilst it&#039;s nice and convenient, I&#039;ve kind-of learned to do without it, largely because yer standard AS array is capable of storing other arrays, objects and hashes within itself.  What&#039;s the big advantage to that?  Well, ActionScript offers list comprehension (check out the MAP function) for VERY quickly operating on every element of an array.  This map() function has its roots in the Lisp world, and it&#039;s a bit of a mind-bender the first time you do it, but with practice, you&#039;ll come to favour it over loops*. 

Moreover, the more you stick to primitive lists, the more interoperability you get with AMF providers, and (let&#039;s say) you end up implementing your server system in Python or Perl or Ruby (or even Lisp!), or something else with good functional programming implementations, you&#039;ll be passing your server a list which it can begin to operate on natively, and vice versa.  Even if you&#039;ve no interest in server-side stuff, I promise you that your server programmer will appreciate you for it.

*Caveat: if you&#039;re writing a function which operates on a list in a order which you must determine, a loop is the way to go.</description>
		<content:encoded><![CDATA[<p>Nice solutions (I just used your array-randomize routine), but I&#8217;ve a comment on ArrayCollection:  whilst it&#8217;s nice and convenient, I&#8217;ve kind-of learned to do without it, largely because yer standard AS array is capable of storing other arrays, objects and hashes within itself.  What&#8217;s the big advantage to that?  Well, ActionScript offers list comprehension (check out the MAP function) for VERY quickly operating on every element of an array.  This map() function has its roots in the Lisp world, and it&#8217;s a bit of a mind-bender the first time you do it, but with practice, you&#8217;ll come to favour it over loops*. </p>
<p>Moreover, the more you stick to primitive lists, the more interoperability you get with AMF providers, and (let&#8217;s say) you end up implementing your server system in Python or Perl or Ruby (or even Lisp!), or something else with good functional programming implementations, you&#8217;ll be passing your server a list which it can begin to operate on natively, and vice versa.  Even if you&#8217;ve no interest in server-side stuff, I promise you that your server programmer will appreciate you for it.</p>
<p>*Caveat: if you&#8217;re writing a function which operates on a list in a order which you must determine, a loop is the way to go.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

