<?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: Map Performance</title>
	<atom:link href="http://jacksondunstan.com/articles/479/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com/articles/479</link>
	<description>Mastering AS3</description>
	<lastBuildDate>Thu, 29 Jul 2010 17:30:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-462</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Sun, 20 Dec 2009 23:35:47 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-462</guid>
		<description>This is a valid concern. I agree that this would make the results more consistent. However, I see that approach as unfair to the non-&lt;tt&gt;Vector&lt;/tt&gt; data structures. Since try/catch is not required for them, the results would be slower than they &lt;em&gt;need&lt;/em&gt; to be. Any knowledgeable programmer would know that a try/catch is not required (an error will never be thrown) and would therefore not use a try/catch. So what I&#039;ve essentially done in my testing is recognize the extra burden that &lt;tt&gt;Vector&lt;/tt&gt; places on its users: a try/catch. Testing all the other data structures with a try/catch would yield different (but valid!) results that would more accurately show the relative cost of misses. However, my goal is simply different: optimum performance for each data structure.

Thanks for pointing out this small-but-important distinction!</description>
		<content:encoded><![CDATA[<p>This is a valid concern. I agree that this would make the results more consistent. However, I see that approach as unfair to the non-<tt>Vector</tt> data structures. Since try/catch is not required for them, the results would be slower than they <em>need</em> to be. Any knowledgeable programmer would know that a try/catch is not required (an error will never be thrown) and would therefore not use a try/catch. So what I&#8217;ve essentially done in my testing is recognize the extra burden that <tt>Vector</tt> places on its users: a try/catch. Testing all the other data structures with a try/catch would yield different (but valid!) results that would more accurately show the relative cost of misses. However, my goal is simply different: optimum performance for each data structure.</p>
<p>Thanks for pointing out this small-but-important distinction!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimarik</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-461</link>
		<dc:creator>Dimarik</dc:creator>
		<pubDate>Sun, 20 Dec 2009 22:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-461</guid>
		<description>try...catch is very slow. I think you should wrap all testing items in the &quot;Miss&quot; section to try...catch to get relevant results.</description>
		<content:encoded><![CDATA[<p>try&#8230;catch is very slow. I think you should wrap all testing items in the &#8220;Miss&#8221; section to try&#8230;catch to get relevant results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-446</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Sun, 13 Dec 2009 20:43:32 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-446</guid>
		<description>I assume you mean &lt;a href=&quot;http://jpauclair.wordpress.com/2009/12/02/tamarin-part-i-as3-array/&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt;. It was a very interesting read and, from its conclusion that an &lt;tt&gt;Array&lt;/tt&gt; is part dense and part hash, it seems as though my test only covered the faster dense portion. So the performance &lt;em&gt;may&lt;/em&gt; be lower for &lt;tt&gt;Array&lt;/tt&gt; if you index beyond the first &lt;tt&gt;undefined&lt;/tt&gt; value. I would say, in the context of this test, that I&#039;ve tested &lt;tt&gt;Array&lt;/tt&gt; fairly since it would be an avoidable performance mistake to allow undefined values in the &lt;tt&gt;Array&lt;/tt&gt; to cause hash table lookups. Nevertheless, it&#039;s good to consider this and I&#039;m glad you pointed it out.

I&#039;ve just started to read your site and find your articles on Tamarin quite interesting. I&#039;m off to read some more!</description>
		<content:encoded><![CDATA[<p>I assume you mean <a href="http://jpauclair.wordpress.com/2009/12/02/tamarin-part-i-as3-array/" rel="nofollow">this article</a>. It was a very interesting read and, from its conclusion that an <tt>Array</tt> is part dense and part hash, it seems as though my test only covered the faster dense portion. So the performance <em>may</em> be lower for <tt>Array</tt> if you index beyond the first <tt>undefined</tt> value. I would say, in the context of this test, that I&#8217;ve tested <tt>Array</tt> fairly since it would be an avoidable performance mistake to allow undefined values in the <tt>Array</tt> to cause hash table lookups. Nevertheless, it&#8217;s good to consider this and I&#8217;m glad you pointed it out.</p>
<p>I&#8217;ve just started to read your site and find your articles on Tamarin quite interesting. I&#8217;m off to read some more!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jpauclair</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-445</link>
		<dc:creator>jpauclair</dc:creator>
		<pubDate>Sun, 13 Dec 2009 15:32:35 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-445</guid>
		<description>Great article!
But you should read my post about array at jpauclair.wordpress.com
There&#039;s more than one structure in the &quot;Array&quot; and you should do your tests against each.

Thanks!</description>
		<content:encoded><![CDATA[<p>Great article!<br />
But you should read my post about array at jpauclair.wordpress.com<br />
There&#8217;s more than one structure in the &#8220;Array&#8221; and you should do your tests against each.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TwoFace</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-410</link>
		<dc:creator>TwoFace</dc:creator>
		<pubDate>Fri, 27 Nov 2009 14:37:42 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-410</guid>
		<description>As usual great article, thanks!</description>
		<content:encoded><![CDATA[<p>As usual great article, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-404</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Mon, 23 Nov 2009 18:02:47 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-404</guid>
		<description>I do too! I think it&#039;s a great solution if your key is naturally two integers, such as a row/col pair or x/y pair. Doing some arithmetic (probably a multiply and a divide) to get a 1-D index for a &lt;tt&gt;Vector&lt;/tt&gt; is probably enough to make &lt;tt&gt;BitmapData&lt;/tt&gt; competitive in performance. Plus, the resulting code will probably be clearer and, as you point out, you can display it!</description>
		<content:encoded><![CDATA[<p>I do too! I think it&#8217;s a great solution if your key is naturally two integers, such as a row/col pair or x/y pair. Doing some arithmetic (probably a multiply and a divide) to get a 1-D index for a <tt>Vector</tt> is probably enough to make <tt>BitmapData</tt> competitive in performance. Plus, the resulting code will probably be clearer and, as you point out, you can display it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-403</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Mon, 23 Nov 2009 17:58:54 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-403</guid>
		<description>That part didn&#039;t actually matter since the value actually stored in the &lt;tt&gt;Vector&lt;/tt&gt; was irrelevant. The important part was, as Jonathan pointed out, that the test for fixed-size &lt;tt&gt;Vector&lt;/tt&gt; misses was actually &lt;em&gt;hitting&lt;/em&gt; and therefore performing far faster than the dynamic-size &lt;tt&gt;Vector&lt;/tt&gt; test, which was (correctly) &lt;em&gt;missing&lt;/em&gt;. I&#039;ve updated the article now with both your fix and his. Thanks for pointing this out!</description>
		<content:encoded><![CDATA[<p>That part didn&#8217;t actually matter since the value actually stored in the <tt>Vector</tt> was irrelevant. The important part was, as Jonathan pointed out, that the test for fixed-size <tt>Vector</tt> misses was actually <em>hitting</em> and therefore performing far faster than the dynamic-size <tt>Vector</tt> test, which was (correctly) <em>missing</em>. I&#8217;ve updated the article now with both your fix and his. Thanks for pointing this out!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-402</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Mon, 23 Nov 2009 17:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-402</guid>
		<description>Thanks for pointing this out. I&#039;ve updated the article to fix the code and results. It makes much more sense now, too! :)</description>
		<content:encoded><![CDATA[<p>Thanks for pointing this out. I&#8217;ve updated the article to fix the code and results. It makes much more sense now, too! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Og2t</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-401</link>
		<dc:creator>Og2t</dc:creator>
		<pubDate>Mon, 23 Nov 2009 13:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-401</guid>
		<description>I like the idea of mapping values to BitmapData, I wrote a tiny BitmapDebugger class for the C64 hacking tool.
http://play.blog2t.net/flash-as3-c64-intro-previewer/</description>
		<content:encoded><![CDATA[<p>I like the idea of mapping values to BitmapData, I wrote a tiny BitmapDebugger class for the C64 hacking tool.<br />
<a href="http://play.blog2t.net/flash-as3-c64-intro-previewer/" rel="nofollow">http://play.blog2t.net/flash-as3-c64-intro-previewer/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramon Fritsch</title>
		<link>http://jacksondunstan.com/articles/479/comment-page-1#comment-400</link>
		<dc:creator>Ramon Fritsch</dc:creator>
		<pubDate>Mon, 23 Nov 2009 10:53:07 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=479#comment-400</guid>
		<description>Yes, jonathan is right.

please change this:

var vectorDynamic:Vector. = new Vector.(1, false);
             vectorDynamic[0] = 33;
 
             var vectorFixed:Vector. = new Vector.(1, true);
             vectorDynamic[0] = 33;


to this:

var vectorDynamic:Vector. = new Vector.(1, false);
             vectorDynamic[0] = 33;
 
             var vectorFixed:Vector. = new Vector.(1, true);
             vectorFixed[0] = 33;

maybe the results will be different than now.

cheers</description>
		<content:encoded><![CDATA[<p>Yes, jonathan is right.</p>
<p>please change this:</p>
<p>var vectorDynamic:Vector. = new Vector.(1, false);<br />
             vectorDynamic[0] = 33;</p>
<p>             var vectorFixed:Vector. = new Vector.(1, true);<br />
             vectorDynamic[0] = 33;</p>
<p>to this:</p>
<p>var vectorDynamic:Vector. = new Vector.(1, false);<br />
             vectorDynamic[0] = 33;</p>
<p>             var vectorFixed:Vector. = new Vector.(1, true);<br />
             vectorFixed[0] = 33;</p>
<p>maybe the results will be different than now.</p>
<p>cheers</p>
]]></content:encoded>
	</item>
</channel>
</rss>
