<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>labs.hellokeita.com &#187; Performance</title>
	<atom:link href="http://labs.hellokeita.com/category/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.hellokeita.com</link>
	<description>Yet another labs blog</description>
	<lastBuildDate>Mon, 02 Aug 2010 11:20:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fast Metaball Effect in AS3</title>
		<link>http://labs.hellokeita.com/2010/08/02/fast-metaball-effect-in-as3/</link>
		<comments>http://labs.hellokeita.com/2010/08/02/fast-metaball-effect-in-as3/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 11:20:27 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[metaball]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/?p=121</guid>
		<description><![CDATA[
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_metaball_440186771"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="/files/metaball/metaball.swf" />
	<param name="bgcolor" value="#000000" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/metaball/metaball.swf"
			name="fm_metaball_440186771"
			width="400"
			height="300">
		<param name="bgcolor" value="#000000" />
	<!--<![endif]-->
		

var container:Sprite = new Sprite();
var balls:Vector. = new Vector.();
var m:Matrix;
var s:Shape;
var r:Number;
var c:uint;
for(var i:int = 0; i < 10; i++){
	r = Math.random() * 100 + 100;
	m = new Matrix();
	m.createGradientBox(r, r, 0, -r * 0.5, -r * 0.5);
	s = container.addChild(new Shape()) as Shape;
	c = Math.random() * 0xFFFFFF;
	s.graphics.beginGradientFill(GradientType.RADIAL, [c, c], [...]]]></description>
			<content:encoded><![CDATA[<p>[kml_flashembed movie="/files/metaball/metaball.swf" height="300" width="400" fversion="10" useexpressinstall="true" bgcolor="#000000" /]</p>
<p><code><br />
var container:Sprite = new Sprite();<br />
var balls:Vector.<Shape> = new Vector.<Shape>();<br />
var m:Matrix;<br />
var s:Shape;<br />
var r:Number;<br />
var c:uint;<br />
for(var i:int = 0; i < 10; i++){<br />
	r = Math.random() * 100 + 100;<br />
	m = new Matrix();<br />
	m.createGradientBox(r, r, 0, -r * 0.5, -r * 0.5);<br />
	s = container.addChild(new Shape()) as Shape;<br />
	c = Math.random() * 0xFFFFFF;<br />
	s.graphics.beginGradientFill(GradientType.RADIAL, [c, c], [1, 0], [0x00, 0xFF], m);<br />
	s.graphics.drawRect(-r * 0.5, -r * 0.5, r, r);<br />
	s.x = Math.random() * 400;<br />
	s.y = Math.random() * 300;<br />
	moveBall(s);<br />
	balls.push(s);<br />
}<br />
function moveBall(s:Shape):void<br />
{<br />
//whatever easing to move the spheres<br />
}<br />
var s2:Shape = container.addChild(new Shape()) as Shape;<br />
m = new Matrix();<br />
m.createGradientBox(200, 200, 0, -100, -100);<br />
c = Math.random() * 0xFFFFFF;<br />
s2.graphics.beginGradientFill(GradientType.RADIAL, [c, c], [1, 0], [0x00, 0xFF], m);<br />
s2.graphics.drawRect(-100, -100, 200, 200);<br />
var bmpData:BitmapData = new BitmapData(400, 300, true, 0x00000000);<br />
var bmp:Bitmap = addChild(new Bitmap(bmpData)) as Bitmap;<br />
addEventListener(Event.ENTER_FRAME, render);<br />
function render(e:Event):void<br />
{<br />
	s2.x = mouseX;<br />
	s2.y = mouseY;<br />
	bmpData.applyFilter(bmpData, bmpData.rect, new Point(0, 0), new BlurFilter(2, 2, 2));<br />
	bmpData.draw(container);<br />
	var i:int, l:int;<br />
	var aArr:Array = [];<br />
	var c:int;<br />
	for(i = 0; i <= 0xFF; i++)<br />
	{<br />
		c = (i - 0x80) << 1;<br />
		if(c < 0) c = 0;<br />
		aArr[i] = c << 24;<br />
	}<br />
	bmpData.paletteMap(bmpData, bmpData.rect, new Point(0, 0), null, null, null, aArr);<br />
}<br />
</code></p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2010/08/02/fast-metaball-effect-in-as3/&ztz=Fast Metaball Effect in AS3'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2010/08/02/fast-metaball-effect-in-as3/&ztz=Fast Metaball Effect in AS3'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2010/08/02/fast-metaball-effect-in-as3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash App on iPhone is crap</title>
		<link>http://labs.hellokeita.com/2009/11/27/flash-app-on-iphone-is-crap/</link>
		<comments>http://labs.hellokeita.com/2009/11/27/flash-app-on-iphone-is-crap/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 14:59:40 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[cs5]]></category>
		<category><![CDATA[flash builder]]></category>
		<category><![CDATA[flash pro]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[London]]></category>
		<category><![CDATA[Max]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/?p=101</guid>
		<description><![CDATA[I went today for Adobe Back from MAX conference here in London. It&#8217;s like a mashup of what they showed at Adobe MAX LA.
Well, here is the note I took, and I&#8217;m really disapointed about Flash app in iPhone&#8230;

Flash app on iPhone:
- It&#8217;s a &#8220;static&#8221; app. Only SWFs packed in the app can be loaded. [...]]]></description>
			<content:encoded><![CDATA[<p>I went today for Adobe Back from MAX conference here in London. It&#8217;s like a mashup of what they showed at Adobe MAX LA.</p>
<p>Well, here is the note I took, and I&#8217;m really disapointed about Flash app in iPhone&#8230;<br />
<strong><br />
Flash app on iPhone:</strong><br />
- It&#8217;s a &#8220;static&#8221; app. Only SWFs packed in the app can be loaded. No SWFs from outside can be loaded;<br />
- You can load images, sound, text from outside;<br />
- No H.264, RTMPT, PixelBender&#8230;;<br />
- No access to Mic / Camera;<br />
- No access to Native API like Maps;<br />
- The packed file size is at least 2.7mb because they have to bundle all the functionalities because the compiler doesn&#8217;t know what is being used or not;</p>
<p><strong>Flash Embed in HTML<br />
</strong>- You can assign a priority to swfs during embed, so in a page with 2 banners and a main swf, can assign main swf a higher priority for performance;</p>
<p><strong>Flash Catalyst</strong><br />
- easy integration of Photoshop/Illustrator design with Flash, using Catalyst.<br />
- good for prototyping and IAs<br />
- skinning components easy<br />
- you can create a Flex Project directly from Catalyst, but the Flex Project can&#8217;t be loaded in Catalyst<br />
- you can create just a Library Project so you can change components skins easily</p>
<p><strong>Flash Pro CS5</strong><br />
- Text Framework integrated (http://labs.adobe.com/technologies/textlayout/)<br />
- AS3 snippets for designers, creates simple interactive code as Keyboard / Mouse interaction<br />
- Can save FLA or a uncompressed FLA format, that is a bunch of XML&#8217;s and assets inside a folder.<br />
- The uncompressed file format is good to change the assets without opening the FLA file</p>
<p><strong>Flash Builder</strong><br />
- You can easily create Flash Project and select a FLA file<br />
- Better integration with back-end stuff, WebServices / AMF (CF, PHP, Java)<br />
- Code generator for WebService / AMF<br />
- Network monitor, to monitor webservices and AMF<br />
- Easily create CMS, selecting the data origin, can be set to edit or only ready the data</p>
<p><strong>Flash Distribution</strong><br />
- Monetization, using Adobe ID, sell Flash / AIR products<br />
- Apps supports Ads<br />
- Frameworks to make easier integrations with social network.</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/11/27/flash-app-on-iphone-is-crap/&ztz=Flash App on iPhone is crap'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/11/27/flash-app-on-iphone-is-crap/&ztz=Flash App on iPhone is crap'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2009/11/27/flash-app-on-iphone-is-crap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LFPUG Presentation and Sources</title>
		<link>http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/</link>
		<comments>http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 10:01:56 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Komposer]]></category>
		<category><![CDATA[LFPUG]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Sandy3d]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[dynamic sound]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/?p=85</guid>
		<description><![CDATA[As promissed, here is the presentation I made at LFPUG in PDF format.
http://www.hellokeita.in/presentations/LFPUG/20090827/MakingMusicFP10.pdf
And the source files zipped with the demos I showed.
http://www.hellokeita.in/presentations/LFPUG/20090827/examples.zip
The contents are:
Example01-SineWaveExample: Simple example generating a sine wave
Example02-KeyboardExample: Example of a piano keyboard
Example03-WaveformExample: Changing the waveform of a sound
Example04-TimePitchExample: Changing pitch and tempo of a mp3
Example05-HeliumBalloon: Real time pitch shifting using Java
Enjoy!
UPDATE
LFPUG website [...]]]></description>
			<content:encoded><![CDATA[<p>As promissed, here is the presentation I made at LFPUG in PDF format.</p>
<p><a href="http://www.hellokeita.in/presentations/LFPUG/20090827/MakingMusicFP10.pdf" target="_blank">http://www.hellokeita.in/presentations/LFPUG/20090827/MakingMusicFP10.pdf</a></p>
<p>And the source files zipped with the demos I showed.</p>
<p><a href="http://www.hellokeita.in/presentations/LFPUG/20090827/examples.zip" target="_blank">http://www.hellokeita.in/presentations/LFPUG/20090827/examples.zip</a><br />
The contents are:<br />
Example01-SineWaveExample: Simple example generating a sine wave<br />
Example02-KeyboardExample: Example of a piano keyboard<br />
Example03-WaveformExample: Changing the waveform of a sound<br />
Example04-TimePitchExample: Changing pitch and tempo of a mp3<br />
Example05-HeliumBalloon: Real time pitch shifting using Java</p>
<p>Enjoy!</p>
<p><font color="#FF0000">UPDATE</font><br />
LFPUG website uploaded the video of my presentation<br />
<a href="http://www.lfpug.com/flash-10-making-music/" target="_blank">http://www.lfpug.com/flash-10-making-music/</a></p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/&ztz=LFPUG Presentation and Sources'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/&ztz=LFPUG Presentation and Sources'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fake Pitch Shifting</title>
		<link>http://labs.hellokeita.com/2009/08/19/fake-pitch-shifting/</link>
		<comments>http://labs.hellokeita.com/2009/08/19/fake-pitch-shifting/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 16:24:52 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[Komposer]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[Daft Punk]]></category>
		<category><![CDATA[dynamic sound]]></category>
		<category><![CDATA[LFPUG]]></category>
		<category><![CDATA[Pitch]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/?p=70</guid>
		<description><![CDATA[Pitch shifting is the method to change the frequency or the height of a sound.
And why it&#8217;s fake? Because, I&#8217;m really not using the correct algorithm, actually I just made one for demo purpose. If you listen carefully, you can hear some clippings when you change the slider position.
There is a difference between my previous [...]]]></description>
			<content:encoded><![CDATA[<p>Pitch shifting is the method to change the frequency or the height of a sound.<br />
And why it&#8217;s fake? Because, I&#8217;m really not using the correct algorithm, actually I just made one for demo purpose. If you listen carefully, you can hear some clippings when you change the slider position.</p>
<p>There is a difference between my previous post about pitch <a href="http://labs.hellokeita.com/2009/05/20/controlling-pitch-and-tempo/" target="_blank">Controlling Pitch and Tempo</a>.<br />
The previous one I was using a dynamically generated sine wave and changing the pitch. It&#8217;s much easier because I already have the samples for each sound.<br />
<br/><br />
On this example I&#8217;m using an MP3 file (Daft Punk, please don&#8217;t sue me&#8230;If you want, I can change it) and changing the pitch on runtime.<br />
<br />
Well it&#8217;s working, and as you can see no FPS loss.</p>
<p>[kml_flashembed fversion="10.0.0" movie="/files/pitchShifting/PitchShifting.swf" targetclass="flashmovie" publishmethod="static" width="400" height="300"]</p>
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>The source&#8230; well, I&#8217;m preparing for my <a href="http://www.lfpug.com/27th-august-2009-27082009/" target="_blank">LFPUG presentation</a> so, I&#8217;ll try to explain about it there, and than release some kind of source.</p>
<p>There is a post from my friend Li <a href="http://www.lidev.com.ar/?p=237" target="_blank">http://www.lidev.com.ar/?p=237</a> where he is using more accurate algorithm to change the pitch. There&#8217;s not much loss on quality and no clips.</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/08/19/fake-pitch-shifting/&ztz=Fake Pitch Shifting'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/08/19/fake-pitch-shifting/&ztz=Fake Pitch Shifting'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2009/08/19/fake-pitch-shifting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BitmapData.lock benchmark</title>
		<link>http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/</link>
		<comments>http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 10:22:34 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Sandy3d]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/</guid>
		<description><![CDATA[Well, I don&#8217;t know if anybody read the Thomas Pfeiffer aka Kiroukou (the Sandy3D creator and project leader) commented on my previous post.
Here&#8217;s what he said.
 Indeed Sandy does a clone of the original texture, for few reasons:
- avoid an unfortunate dispose call.
- allowing to have a setTransparency method to dynamically change the transparency without [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I don&#8217;t know if anybody read the Thomas Pfeiffer aka Kiroukou (the <a href="http://www.flashsandy.org/" target="_blank">Sandy3D</a> creator and project leader) commented on my <a href="http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/#comments" target="_blank">previous post</a>.<br />
Here&#8217;s what he said.</p>
<blockquote><p> Indeed Sandy does a clone of the original texture, for few reasons:<br />
- avoid an unfortunate dispose call.<br />
- allowing to have a setTransparency method to dynamically change the transparency without changing the original bitmapdata of the user.</p>
<p>Concerning the lock() and unclock() are you sure it has a performance impact?<br />
as far I know, this can’t provide any performance boost since the bitmapdata isn’t attached to the flash display list. When the object is out of stage, there’s no advantage to lock it.<br />
But I’d be interessted to have your feedback about that, and your performance test.</p></blockquote>
<p>About the BitmapData.clone(), he got his point.<br />
It just don&#8217;t work for me because I&#8217;m using too many 3d Objects with different BitmapMaterial for each, so, the system memory gets too high.<br />
But, about the setTransparency method, he is right.</p>
<p>About the lock and unlock methods, I runned a little benchmark test, because I got curious too how much performance boost you can get.<br />
Here&#8217;s the two test I made. (Clicking on the flash area it will re-run the benchmark test)</p>
<p>Using the lock and unlock methods.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_bitmapLockBenchmark_917457238"
			class="flashmovie"
			width="200"
			height="30">
	<param name="movie" value="/files/benchmark/20071203/bitmapLockBenchmark.swf" />
	<param name="bgcolor" value="#f9f9f9" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071203/bitmapLockBenchmark.swf"
			name="fm_bitmapLockBenchmark_917457238"
			width="200"
			height="30">
		<param name="bgcolor" value="#f9f9f9" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Not using the lock and unlock methods.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_noBitmapLockBenchmark_472374820"
			class="flashmovie"
			width="200"
			height="30">
	<param name="movie" value="/files/benchmark/20071203/noBitmapLockBenchmark.swf" />
	<param name="bgcolor" value="#f9f9f9" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071203/noBitmapLockBenchmark.swf"
			name="fm_noBitmapLockBenchmark_472374820"
			width="200"
			height="30">
		<param name="bgcolor" value="#f9f9f9" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>It&#8217;s a really simple test, just to make a benchmark test.<br />
Actually, it&#8217;s not a situation that uses any 3d framework.</p>
<p>Creating a BitmapData.<br />
Creating 1000 Bitmaps.<br />
Applying 1000 times a BlurFilter over the BitmapData.</p>
<p>On my PC I get about 150ms faster with locking the BitmapData.</p>
<p>keita</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/&ztz=BitmapData.lock benchmark'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/&ztz=BitmapData.lock benchmark'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BitmapMaterial tips</title>
		<link>http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/</link>
		<comments>http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 08:05:46 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Papervision3d]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Sandy3d]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/</guid>
		<description><![CDATA[I was making some experiments with Sandy3d and Papervision3d and I realized some tips to increase the performance.
Firstly, with Sandy3d 3.0, when you create a BitmapMaterial, the BitmapData that you used to create the Material, is cloned to create the BitmapMaterial.texture.
So, one think you can do is dispose the BitmapData that you used to create [...]]]></description>
			<content:encoded><![CDATA[<p>I was making some experiments with <a href="http://www.flashsandy.org/" target="_blank">Sandy3d</a> and <a href="http://blog.papervision3d.org" target="_blank">Papervision3d</a> and I realized some tips to increase the performance.</p>
<p>Firstly, with <a href="http://www.flashsandy.org/" target="_blank">Sandy3d</a> 3.0, when you create a BitmapMaterial, the BitmapData that you used to create the Material, is cloned to create the BitmapMaterial.texture.<br />
So, one think you can do is dispose the BitmapData that you used to create the Material after instantiating it and also, if you want to update your BitmapData use the BitmapMaterial.texture directly.</p>
<p>Something like this:<br />
[code lang="actionscript"]<br />
var bmpData:BitmapData = new BitmapData(100, 100, true, 0x00000000);<br />
var bmpMaterial:BitmapMaterial = new BitmapMaterial(bmpData);</p>
<p>bmpData.dispose();</p>
<p>bmpMaterial.texture.fillRect(new Rectangle(10,10,30,30), 0xffff0000);<br />
[/code]<br />
This will not work with Papervision3d because it uses the same BitmapData instance (in my opinion, smarter).</p>
<p>Now for both, <a href="http://www.flashsandy.org/" target="_blank">Sandy3d</a> and <a href="http://blog.papervision3d.org" target="_blank">Papervision3d</a>.<br />
As you make changes on your BitmapData, it&#8217;s updated on every poligon.<br />
So, use the BitmapData.lock() and BitmapData.unlock() when you are redrawing your BitmapData texture.</p>
<p>[code lang="actionscript"]<br />
var bmpData:BitmapData = new BitmapData(100, 100, false, 0x00000000);<br />
var bmpMaterial:BitmapMaterial = new BitmapMaterial(bmpData);</p>
<p>redrawBitmap();</p>
<p>...</p>
<p>function redrawBitmap(){</p>
<p>bmpData.lock();</p>
<p>bmpData.fillRect(bmpData.rect, 0x00000000);<br />
bmpData.fillRect(new Rectangle(10,10,30,30), 0xffff0000);</p>
<p>var blurFilter:BlurFilter = new BlurFilter(16, 16, 3);</p>
<p>bmpData.applyFilter(bmpData, bmpData.rect, new Point(0,0), blurFilter);</p>
<p>bmpData.unlock();</p>
<p>}<br />
[/code]</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/&ztz=BitmapMaterial tips'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/&ztz=BitmapMaterial tips'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BitmapData.draw x Graphics.beginBitmapFill</title>
		<link>http://labs.hellokeita.com/2007/11/08/bitmapdatadraw-x-graphicsbeginbitmapfill/</link>
		<comments>http://labs.hellokeita.com/2007/11/08/bitmapdatadraw-x-graphicsbeginbitmapfill/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 16:12:57 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/11/08/bitmapdatadraw-x-graphicsbeginbitmapfill/</guid>
		<description><![CDATA[Firstly&#8230; sorry for my poor English&#8230;
Working on Recyou.jp, I had to use many BitmapDatas, and so, I had to work out some way to make it lighter.
One thing I realized is that using Graphics.beginBitmapFill besides BitmapData.draw its much faster.
I made the benchmarks, drawing 10000 bitmapDatas, one using BitmapData.draw, and other using Graphics.beginBitmapFill.
First the benchmark with [...]]]></description>
			<content:encoded><![CDATA[<p>Firstly&#8230; sorry for my poor English&#8230;</p>
<p>Working on Recyou.jp, I had to use many BitmapDatas, and so, I had to work out some way to make it lighter.<br />
One thing I realized is that using Graphics.beginBitmapFill besides BitmapData.draw its much faster.</p>
<p>I made the benchmarks, drawing 10000 bitmapDatas, one using BitmapData.draw, and other using Graphics.beginBitmapFill.</p>
<p>First the benchmark with BitmapData.draw (Clicking on the flash it will re-run the benchmark):<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_b1_846604802"
			class="flashmovie"
			width="200"
			height="40">
	<param name="movie" value="/files/benchmark/20071108/b1.swf" />
	<param name="bgcolor" value="#f9f9f9" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071108/b1.swf"
			name="fm_b1_846604802"
			width="200"
			height="40">
		<param name="bgcolor" value="#f9f9f9" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
The code is something like this:<br />
[code lang="actionscript"]<br />
var genericBmp:BitmapData = new BitmapData(100,100, false, 0x000000);<br />
var bmp:BitmapData = new BitmapData(100,100, false, 0x000000);<br />
for(var i = 0; i &lt; 10000; i++){<br />
bmp.draw(genericBmp);<br />
}<br />
[/code]</p>
<p>Now the benchmark with Graphics.beginBitmapFill (Clicking on the flash it will re-run the benchmark):<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_b2_442765777"
			class="flashmovie"
			width="200"
			height="40">
	<param name="movie" value="/files/benchmark/20071108/b2.swf" />
	<param name="bgcolor" value="#f9f9f9" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071108/b2.swf"
			name="fm_b2_442765777"
			width="200"
			height="40">
		<param name="bgcolor" value="#f9f9f9" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
The code is something like this:<br />
[code lang="actionscript"]<br />
var genericBmp:BitmapData = new BitmapData(100,100, false, 0x000000);<br />
var bmp:BitmapData = new BitmapData(100,100, false, 0x000000);<br />
for(var i = 0; i &lt; 10000; i++){<br />
graphics.beginBitmapFill(genericBmp);<br />
graphics.drawRect(0,0,100,100);<br />
}<br />
[/code]</p>
<p>So, if you are trying to create some bitmap pattens or attaching a Bitmap child and redrawing it&#8217;s BitmapData, try using the Graphics.beginBitmapFill.</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/08/bitmapdatadraw-x-graphicsbeginbitmapfill/&ztz=BitmapData.draw x Graphics.beginBitmapFill'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/08/bitmapdatadraw-x-graphicsbeginbitmapfill/&ztz=BitmapData.draw x Graphics.beginBitmapFill'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/11/08/bitmapdatadraw-x-graphicsbeginbitmapfill/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Launching my public subversion</title>
		<link>http://labs.hellokeita.com/2007/10/24/launching-my-public-subversion/</link>
		<comments>http://labs.hellokeita.com/2007/10/24/launching-my-public-subversion/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 18:32:55 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[AVM1]]></category>
		<category><![CDATA[AVM2]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/10/24/launching-my-public-subversion/</guid>
		<description><![CDATA[http://code.hellokeita.in/public/
People, I&#8217;m launching my codes on public subversion repository.
It&#8217;s almost nothing there&#8230; but, how people claimed for the source (here), there is it.
Hope you enjoy it&#8230;
PS: If there&#8217;s any bug or anything I forgot, apologize me&#8230; I still don&#8217;t get much time to review my codes&#8230;
 Vote]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.hellokeita.in/public/" target="_blank">http://code.hellokeita.in/public/</a></p>
<p>People, I&#8217;m launching my codes on public subversion repository.<br />
It&#8217;s almost nothing there&#8230; but, how people claimed for the source (<a href="http://labs.hellokeita.com/2007/09/20/textanimation/#comments" target="_blank">here</a>), there is it.</p>
<p>Hope you enjoy it&#8230;</p>
<p>PS: If there&#8217;s any bug or anything I forgot, apologize me&#8230; I still don&#8217;t get much time to review my codes&#8230;</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/10/24/launching-my-public-subversion/&ztz=Launching my public subversion'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/10/24/launching-my-public-subversion/&ztz=Launching my public subversion'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/10/24/launching-my-public-subversion/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Performance increase with BitmapData</title>
		<link>http://labs.hellokeita.com/2007/10/07/performance-increase-with-bitmapdata/</link>
		<comments>http://labs.hellokeita.com/2007/10/07/performance-increase-with-bitmapdata/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 10:18:03 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/10/07/performance-increase-with-bitmapdata/</guid>
		<description><![CDATA[I&#8217;m working on a project that everything eats performance, using FLV videos, animated smooth Bitmaps, Papervision3D and everything else&#8230;
So I started desperately find a way to increase the flash performance.
So, I realized that using BitmapDatas instead using many sprites and FLV videos helped really much.
I mean, instead adding a full screen FLV streaming video on [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a project that everything eats performance, using FLV videos, animated smooth Bitmaps, Papervision3D and everything else&#8230;<br />
So I started desperately find a way to increase the flash performance.</p>
<p>So, I realized that using BitmapDatas instead using many sprites and FLV videos helped really much.<br />
I mean, instead adding a full screen FLV streaming video on your background, add a Bitmap child on your background that draws the FLV child.</p>
<p>I didn&#8217;t make any benchmarks, but, at least on this project it&#8217;s helping me speeding up my heavy processing flash.</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/10/07/performance-increase-with-bitmapdata/&ztz=Performance increase with BitmapData'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/10/07/performance-increase-with-bitmapdata/&ztz=Performance increase with BitmapData'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/10/07/performance-increase-with-bitmapdata/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
