<?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: Array vs. Vector Part II</title>
	<atom:link href="http://jacksondunstan.com/articles/649/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com/articles/649</link>
	<description>Mastering AS3</description>
	<lastBuildDate>Tue, 07 Feb 2012 09:30:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Miracle</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-20218</link>
		<dc:creator>Miracle</dc:creator>
		<pubDate>Fri, 13 Jan 2012 07:16:13 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-20218</guid>
		<description>Your posting really straihgetend me out. Thanks!</description>
		<content:encoded><![CDATA[<p>Your posting really straihgetend me out. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-14780</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Mon, 24 Oct 2011 15:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-14780</guid>
		<description>That&#039;s definitely the faster way of going, but in this case the point of the test was to compare the performance of &lt;code&gt;delete&lt;/code&gt; on &lt;code&gt;Array&lt;/code&gt; and &lt;code&gt;Vector&lt;/code&gt; in case you ever do want to do it. Hopefully the slow results convince you not to. :)</description>
		<content:encoded><![CDATA[<p>That&#8217;s definitely the faster way of going, but in this case the point of the test was to compare the performance of <code>delete</code> on <code>Array</code> and <code>Vector</code> in case you ever do want to do it. Hopefully the slow results convince you not to. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joist</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-14762</link>
		<dc:creator>Joist</dc:creator>
		<pubDate>Mon, 24 Oct 2011 10:37:21 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-14762</guid>
		<description>I&#039;m curious to know why you use delete on the vectorObjects instead of nulling the reference.

&lt;pre lang=&quot;actionscript3&quot;&gt;
//3852
delete vectorObject[j];

//150
vectorObject[j] = null;
&lt;pre&gt;

also when the array is full of objects

&lt;pre lang=&quot;actionscript3&quot;&gt;
//3904
delete array[j];

//100
array[j] = null;
&lt;pre&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m curious to know why you use delete on the vectorObjects instead of nulling the reference.</p>
<pre lang="actionscript3">
//3852
delete vectorObject[j];

//150
vectorObject[j] = null;
</pre>
<pre>

also when the array is full of objects
</pre>
<pre lang="actionscript3">
//3904
delete array[j];

//100
array[j] = null;
</pre>
<pre></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-598</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Tue, 23 Mar 2010 17:16:13 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-598</guid>
		<description>You&#039;re right that &lt;tt&gt;delete&lt;/tt&gt; is doing nothing to the &lt;tt&gt;Vector&lt;/tt&gt; and setting the element to &lt;tt&gt;undefined&lt;/tt&gt; in the &lt;tt&gt;Array&lt;/tt&gt;. In the &lt;tt&gt;Array&lt;/tt&gt;&#039;s case, it may also &lt;a href=&quot;/articles/529&quot; rel=&quot;nofollow&quot;&gt;break&lt;/a&gt; the dense/hash portions up, but that&#039;s not the case here given the deletion at the end.

Given that, it seems very odd that &lt;tt&gt;delete&lt;/tt&gt; would take so long. Were you perhaps &lt;a href=&quot;/articles/636#comment-578&quot; rel=&quot;nofollow&quot;&gt;referring&lt;/a&gt; to the time taken by &lt;tt&gt;shift&lt;/tt&gt;, &lt;tt&gt;pop&lt;/tt&gt;, and &lt;tt&gt;splice&lt;/tt&gt; instead?</description>
		<content:encoded><![CDATA[<p>You&#8217;re right that <tt>delete</tt> is doing nothing to the <tt>Vector</tt> and setting the element to <tt>undefined</tt> in the <tt>Array</tt>. In the <tt>Array</tt>&#8216;s case, it may also <a href="/articles/529" rel="nofollow">break</a> the dense/hash portions up, but that&#8217;s not the case here given the deletion at the end.</p>
<p>Given that, it seems very odd that <tt>delete</tt> would take so long. Were you perhaps <a href="/articles/636#comment-578" rel="nofollow">referring</a> to the time taken by <tt>shift</tt>, <tt>pop</tt>, and <tt>splice</tt> instead?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bolder then the Bold &#8211; The 9700 Rocks! &#124; Iphone Bizarre</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-597</link>
		<dc:creator>Bolder then the Bold &#8211; The 9700 Rocks! &#124; Iphone Bizarre</dc:creator>
		<pubDate>Tue, 23 Mar 2010 15:32:47 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-597</guid>
		<description>[...] Array vs. Vector Part II « JacksonDunstan.com [...]</description>
		<content:encoded><![CDATA[<p>[...] Array vs. Vector Part II « JacksonDunstan.com [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jpauclair</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-596</link>
		<dc:creator>jpauclair</dc:creator>
		<pubDate>Tue, 23 Mar 2010 13:55:23 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-596</guid>
		<description>delete the element from a vector is doing nothing exept returning true, the reference stay the same.
For the array, it sets the element to undefined.</description>
		<content:encoded><![CDATA[<p>delete the element from a vector is doing nothing exept returning true, the reference stay the same.<br />
For the array, it sets the element to undefined.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jpauclair</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-595</link>
		<dc:creator>jpauclair</dc:creator>
		<pubDate>Tue, 23 Mar 2010 13:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-595</guid>
		<description>You delete multiple time the same element.
Also, is &quot;delete&quot; actualy removing the element? I guess not if you can loop on it again...

&lt;pre lang=&quot;actionscript3&quot;&gt;
for (i = 0; i = 0; --j)
{
	delete vectorObject[j];
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You delete multiple time the same element.<br />
Also, is &#8220;delete&#8221; actualy removing the element? I guess not if you can loop on it again&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>i = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000066; font-weight: bold;">--</span>j<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">delete</span> vectorObject<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: aaulia</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-594</link>
		<dc:creator>aaulia</dc:creator>
		<pubDate>Tue, 23 Mar 2010 12:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-594</guid>
		<description>If your reference to the object is only the array/vector, then yes it will be GC-ed. But if you have reference to the object other than the one in the array/vector (another variable maybe) then the object will live on, until the reference is removed. The best solution for things like this is Object Polling, you don&#039;t have to delete the object, instead you recycle it.</description>
		<content:encoded><![CDATA[<p>If your reference to the object is only the array/vector, then yes it will be GC-ed. But if you have reference to the object other than the one in the array/vector (another variable maybe) then the object will live on, until the reference is removed. The best solution for things like this is Object Polling, you don&#8217;t have to delete the object, instead you recycle it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TwoFace</title>
		<link>http://jacksondunstan.com/articles/649/comment-page-1#comment-593</link>
		<dc:creator>TwoFace</dc:creator>
		<pubDate>Tue, 23 Mar 2010 10:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=649#comment-593</guid>
		<description>Hm, just wondering, what will be with object when you will not delete it from array/vector but replace it with NaN/null? Does the GC collect it or what?</description>
		<content:encoded><![CDATA[<p>Hm, just wondering, what will be with object when you will not delete it from array/vector but replace it with NaN/null? Does the GC collect it or what?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

