<?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: Using BitmapData for Array manipulation in AS3</title>
	<atom:link href="http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/</link>
	<description>A blog about Adobe Flex</description>
	<lastBuildDate>Sun, 14 Mar 2010 01:29:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: adrien</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-208617</link>
		<dc:creator>adrien</dc:creator>
		<pubDate>Sun, 22 Nov 2009 09:09:19 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-208617</guid>
		<description>this is great i was looking exactly for this kind of benchmark before continuing with my project,
i only need comparison to tell me if 2 bytearray vars are the same, no reunion intersection.
do you think bytearray.compress before compare would speed up ? i have flash player 10
and all tests were faster for me using bytearr and not bitmapdata</description>
		<content:encoded><![CDATA[<p>this is great i was looking exactly for this kind of benchmark before continuing with my project,<br />
i only need comparison to tell me if 2 bytearray vars are the same, no reunion intersection.<br />
do you think bytearray.compress before compare would speed up ? i have flash player 10<br />
and all tests were faster for me using bytearr and not bitmapdata</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mzx</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-207392</link>
		<dc:creator>mzx</dc:creator>
		<pubDate>Thu, 29 Jan 2009 17:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-207392</guid>
		<description>nice catch. There are some &quot;optimized&quot; pieces in flash player that works better than other. Images/filters likely uses some parallel calculations</description>
		<content:encoded><![CDATA[<p>nice catch. There are some &#8220;optimized&#8221; pieces in flash player that works better than other. Images/filters likely uses some parallel calculations</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-207337</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Sun, 21 Dec 2008 04:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-207337</guid>
		<description>Nice visual solution.  I see interesting potential combining visual with functional. ;)</description>
		<content:encoded><![CDATA[<p>Nice visual solution.  I see interesting potential combining visual with functional. <img src='http://dougmccune.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: todd</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-177372</link>
		<dc:creator>todd</dc:creator>
		<pubDate>Wed, 17 Sep 2008 19:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-177372</guid>
		<description>Seems like a sparse matrix could be useful in this type of solution.  But, I wonder 1) if there&#039;s an Actionscript implementation anywhere, and 2) how it&#039;d fare in this test regarding speed 3) assume just a couple of on/off state of what you did with the bitmapdata.  Maybe not, though.</description>
		<content:encoded><![CDATA[<p>Seems like a sparse matrix could be useful in this type of solution.  But, I wonder 1) if there&#8217;s an Actionscript implementation anywhere, and 2) how it&#8217;d fare in this test regarding speed 3) assume just a couple of on/off state of what you did with the bitmapdata.  Maybe not, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hadrien</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-175952</link>
		<dc:creator>Hadrien</dc:creator>
		<pubDate>Mon, 15 Sep 2008 18:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-175952</guid>
		<description>Nice hack!
Have you tried BitVector class from http://lab.polygonal.de/ds/ ?</description>
		<content:encoded><![CDATA[<p>Nice hack!<br />
Have you tried BitVector class from <a href="http://lab.polygonal.de/ds/" rel="nofollow">http://lab.polygonal.de/ds/</a> ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Bustin</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-175646</link>
		<dc:creator>Alex Bustin</dc:creator>
		<pubDate>Mon, 15 Sep 2008 05:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-175646</guid>
		<description>I wanted to imitate your BitmapData method thus the three ByteArrays.  So yes, I&#039;m sure it could be optimized ;).

Anyway, glad to have added to the pot. See you at MAX!</description>
		<content:encoded><![CDATA[<p>I wanted to imitate your BitmapData method thus the three ByteArrays.  So yes, I&#8217;m sure it could be optimized <img src='http://dougmccune.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Anyway, glad to have added to the pot. See you at MAX!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-175599</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Mon, 15 Sep 2008 03:01:24 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-175599</guid>
		<description>@Alex - I updated the test app to include a test that uses ByteArray. I also modified your code to use writeBoolean() and readBoolean() instead of writeByte() and readByte(). I did brief testing and I think that squeezed a little more speed out of it (but I could be wrong). I also didn&#039;t create the comparison ByteArray like you had in your code, since I don&#039;t think that was really needed.</description>
		<content:encoded><![CDATA[<p>@Alex &#8211; I updated the test app to include a test that uses ByteArray. I also modified your code to use writeBoolean() and readBoolean() instead of writeByte() and readByte(). I did brief testing and I think that squeezed a little more speed out of it (but I could be wrong). I also didn&#8217;t create the comparison ByteArray like you had in your code, since I don&#8217;t think that was really needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-175590</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Mon, 15 Sep 2008 02:33:06 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-175590</guid>
		<description>@Alex - nice! I&#039;m going to use that bytearray method and put together another side-by-side test. My tests indicate that it&#039;s about the same speed as the others on the 10k and 100k tests, but when you get into the 1 million items test it shaves off a solid second.

The test you posted doesn&#039;t calculate the processing time in the same way my tests do though. Your test doesn&#039;t account for the filtering time in the total duration, and since a big chunk of the work required for the algorithm to run (calling byteArray.writeByte) happens in the filtering function, that needs to be included in the duration benchmark as well. Once that gets thrown in the numbers look more like the other tests (but like I said, when you get into millions of records the bytearray method pulls ahead)</description>
		<content:encoded><![CDATA[<p>@Alex &#8211; nice! I&#8217;m going to use that bytearray method and put together another side-by-side test. My tests indicate that it&#8217;s about the same speed as the others on the 10k and 100k tests, but when you get into the 1 million items test it shaves off a solid second.</p>
<p>The test you posted doesn&#8217;t calculate the processing time in the same way my tests do though. Your test doesn&#8217;t account for the filtering time in the total duration, and since a big chunk of the work required for the algorithm to run (calling byteArray.writeByte) happens in the filtering function, that needs to be included in the duration benchmark as well. Once that gets thrown in the numbers look more like the other tests (but like I said, when you get into millions of records the bytearray method pulls ahead)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Bustin</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-175562</link>
		<dc:creator>Alex Bustin</dc:creator>
		<pubDate>Mon, 15 Sep 2008 01:10:47 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-175562</guid>
		<description>Not tested fully yet ... but I seem to have gained good performance with ByteArray .. 

http://thebackbutton.com/filtertest/Filter.html
http://thebackbutton.com/filtertest/srcview/</description>
		<content:encoded><![CDATA[<p>Not tested fully yet &#8230; but I seem to have gained good performance with ByteArray .. </p>
<p><a href="http://thebackbutton.com/filtertest/Filter.html" rel="nofollow">http://thebackbutton.com/filtertest/Filter.html</a><br />
<a href="http://thebackbutton.com/filtertest/srcview/" rel="nofollow">http://thebackbutton.com/filtertest/srcview/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rad</title>
		<link>http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/comment-page-1/#comment-175487</link>
		<dc:creator>Rad</dc:creator>
		<pubDate>Sun, 14 Sep 2008 21:33:23 +0000</pubDate>
		<guid isPermaLink="false">http://dougmccune.com/blog/2008/09/13/using-bitmapdata-for-array-manipulation-in-as3/#comment-175487</guid>
		<description>Thanks for sharing cool idea.

Another option to consider is to encode filtered arrays as a bitarray and then use bitwise operations. Using your data as an example

Filtered array can be encoded as:
f1=01101
f2=11110

then 

~f1=10010
~f2=00001

then answer to &quot;unique values in Filtered Array #1 that do not appear in #2 (Item 5)&quot; would be:

f1 &amp; ~f2
01101
00001
-------
00001.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing cool idea.</p>
<p>Another option to consider is to encode filtered arrays as a bitarray and then use bitwise operations. Using your data as an example</p>
<p>Filtered array can be encoded as:<br />
f1=01101<br />
f2=11110</p>
<p>then </p>
<p>~f1=10010<br />
~f2=00001</p>
<p>then answer to &#8220;unique values in Filtered Array #1 that do not appear in #2 (Item 5)&#8221; would be:</p>
<p>f1 &amp; ~f2<br />
01101<br />
00001<br />
&#8212;&#8212;-<br />
00001.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
