<?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: Replacing ENTER_FRAME &#8211; Testing Tickers</title>
	<atom:link href="http://alecmce.com/as3/replacing-enter_frame-testing-tickers/feed" rel="self" type="application/rss+xml" />
	<link>http://alecmce.com/as3/replacing-enter_frame-testing-tickers</link>
	<description>Coding on the Flash Platform</description>
	<lastBuildDate>Thu, 02 Sep 2010 20:49:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: jacksondunstan</title>
		<link>http://alecmce.com/as3/replacing-enter_frame-testing-tickers/comment-page-1#comment-183</link>
		<dc:creator>jacksondunstan</dc:creator>
		<pubDate>Mon, 30 Nov 2009 22:46:44 +0000</pubDate>
		<guid isPermaLink="false">http://alecmce.com/?p=573#comment-183</guid>
		<description>Thanks for the clarification. I assumed that what you were seeing was roughly what I was seeing: inconsistent framerates on the same computer, browser, and player. On my 2.2 Ghz Intel Core 2 Duo with 2 GB RAM on Mac OS X 10.6 (Firefox 3.5) I was getting anywhere between 18 and 20 average FPS on both tests. I would let one of them run for 30 seconds, stop it, run the other for 30 seconds, stop it, and repeat. Sometimes the average would be 18, sometimes 20, and sometimes in between them. Neither test seemed more likely than the other to perform slowly or quickly. I even refreshed the page and tried it a few more times, but there was no change. From this it seemed likely that the random number generation was causing essentially random results, even if only slightly differentiating the two tests. Hence my suggestion to use a random number generator with a &lt;em&gt;constant&lt;/em&gt; seed. I don&#039;t think any JavaScript injection would be necessary since you just need to make sure the seed is the same between them. From there it&#039;s essentially random and repeatable between both tests.&lt;br&gt;&lt;br&gt;Since you pointed out differences between platforms and players, I just tested again on my 3.0 Ghz Intel Core 2 Duo with 4 GB RAM running on Windows XP (Internet Explorer 8). Here I get much closer results than on the Mac. Both seem to run at 17.8 FPS and only vary by +- 0.01 FPS. I should note that I never see any &quot;spikes&quot; in either performance or memory usage on any platform with any test. At least this shows that the FrameLoop ticker is no worse than the ENTER_FRAME ticker...</description>
		<content:encoded><![CDATA[<p>Thanks for the clarification. I assumed that what you were seeing was roughly what I was seeing: inconsistent framerates on the same computer, browser, and player. On my 2.2 Ghz Intel Core 2 Duo with 2 GB RAM on Mac OS X 10.6 (Firefox 3.5) I was getting anywhere between 18 and 20 average FPS on both tests. I would let one of them run for 30 seconds, stop it, run the other for 30 seconds, stop it, and repeat. Sometimes the average would be 18, sometimes 20, and sometimes in between them. Neither test seemed more likely than the other to perform slowly or quickly. I even refreshed the page and tried it a few more times, but there was no change. From this it seemed likely that the random number generation was causing essentially random results, even if only slightly differentiating the two tests. Hence my suggestion to use a random number generator with a <em>constant</em> seed. I don&#39;t think any JavaScript injection would be necessary since you just need to make sure the seed is the same between them. From there it&#39;s essentially random and repeatable between both tests.</p>
<p>Since you pointed out differences between platforms and players, I just tested again on my 3.0 Ghz Intel Core 2 Duo with 4 GB RAM running on Windows XP (Internet Explorer 8). Here I get much closer results than on the Mac. Both seem to run at 17.8 FPS and only vary by +- 0.01 FPS. I should note that I never see any &#8220;spikes&#8221; in either performance or memory usage on any platform with any test. At least this shows that the FrameLoop ticker is no worse than the ENTER_FRAME ticker&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone</title>
		<link>http://alecmce.com/as3/replacing-enter_frame-testing-tickers/comment-page-1#comment-182</link>
		<dc:creator>Simone</dc:creator>
		<pubDate>Mon, 30 Nov 2009 19:27:40 +0000</pubDate>
		<guid isPermaLink="false">http://alecmce.com/?p=573#comment-182</guid>
		<description>Hi Alec,&lt;br&gt;&lt;br&gt;I just forked your repo and added another test case where I use a Timer object that ticks every 1000/defaultFrameRate milliseconds (to emulate the enter frame speed) and I didn&#039;t notice a big difference between the three approaches.&lt;br&gt;&lt;br&gt;here is the repo&lt;br&gt;&lt;a href=&quot;http://github.com/vizio360/TickerStrategies&quot; rel=&quot;nofollow&quot;&gt;http://github.com/vizio360/TickerStrategies&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Hi Alec,</p>
<p>I just forked your repo and added another test case where I use a Timer object that ticks every 1000/defaultFrameRate milliseconds (to emulate the enter frame speed) and I didn&#39;t notice a big difference between the three approaches.</p>
<p>here is the repo<br /><a href="http://github.com/vizio360/TickerStrategies" rel="nofollow">http://github.com/vizio360/TickerStrategies</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alecmce</title>
		<link>http://alecmce.com/as3/replacing-enter_frame-testing-tickers/comment-page-1#comment-181</link>
		<dc:creator>alecmce</dc:creator>
		<pubDate>Mon, 30 Nov 2009 16:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://alecmce.com/?p=573#comment-181</guid>
		<description>Thanks for the feedback, Shaun. &lt;br&gt;&lt;br&gt;Yes, I wondered whether the weight of the test might be an issue, but I wanted to ensure that it would run at slower-than-31fps in order to test performance. If I don&#039;t find the point at which the racetrack comes under strain I&#039;m not sure how to differentiate the performances. However, perhaps I shouldn&#039;t put it under so much strain. Do you have a suggestion? I will try with 2,500 sprites and see how they run.</description>
		<content:encoded><![CDATA[<p>Thanks for the feedback, Shaun. </p>
<p>Yes, I wondered whether the weight of the test might be an issue, but I wanted to ensure that it would run at slower-than-31fps in order to test performance. If I don&#39;t find the point at which the racetrack comes under strain I&#39;m not sure how to differentiate the performances. However, perhaps I shouldn&#39;t put it under so much strain. Do you have a suggestion? I will try with 2,500 sprites and see how they run.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alecmce</title>
		<link>http://alecmce.com/as3/replacing-enter_frame-testing-tickers/comment-page-1#comment-180</link>
		<dc:creator>alecmce</dc:creator>
		<pubDate>Mon, 30 Nov 2009 16:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://alecmce.com/?p=573#comment-180</guid>
		<description>As ever Jackson, thank you for your comment! I am extremely grateful that you read my work carefully and point out contentious points.&lt;br&gt;&lt;br&gt;When I mentioned that I get &quot;different results&quot; I was really referring to the different results I get on different platforms, different players, and so on. The gist of the results (that the Frame Loop appears to use marginally less memory but doesn&#039;t appear to have a performance benefit) seems consistent. However I want to be scientific about it so put in the proviso that I do get inconsistent results and I need to be more rigorous.&lt;br&gt;&lt;br&gt;The random number generation issue is an interesting one. Your repeatable random seed generator is terrific for the sorts of scenarios that you offer such as gaming where you need to ensure that each time you repeat a scenario &#039;random events&#039; happen in a consistent way. In this case, I can guarantee that events happen in roughly the same sort of way (and that the &#039;roughness of that is actually pretty smooth) by sheer weight of randomness. There are 5,000 sprites, to which a random acceleration vector is applied (2 random numbers) every frame. That&#039;s 300,000 random numbers being applied to the model every frame. Over the course of the animation, the aggregate velocities of the elements will approach a normal distribution around zero-velocity. (I&#039;m going to let that point dangle and point to &lt;a href=&quot;http://en.wikipedia.org/wiki/Central_limit_theorem&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Central_limit_theorem&lt;/a&gt;).&lt;br&gt;&lt;br&gt;As you say however, I could implement your (or another - as well as Mersenne Twister, also consider &lt;a href=&quot;http://en.wikipedia.org/wiki/Rule_30&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Rule_30&lt;/a&gt;) repeatable random seed by creating a random seed in JavaScript and injecting that seed into the two Movies to guarantee that they run in parallel each time a user runs them. It would be a pleasing addition to the test, though I very-much doubt it would change the results. I will add it, if I get the time.</description>
		<content:encoded><![CDATA[<p>As ever Jackson, thank you for your comment! I am extremely grateful that you read my work carefully and point out contentious points.</p>
<p>When I mentioned that I get &#8220;different results&#8221; I was really referring to the different results I get on different platforms, different players, and so on. The gist of the results (that the Frame Loop appears to use marginally less memory but doesn&#39;t appear to have a performance benefit) seems consistent. However I want to be scientific about it so put in the proviso that I do get inconsistent results and I need to be more rigorous.</p>
<p>The random number generation issue is an interesting one. Your repeatable random seed generator is terrific for the sorts of scenarios that you offer such as gaming where you need to ensure that each time you repeat a scenario &#39;random events&#39; happen in a consistent way. In this case, I can guarantee that events happen in roughly the same sort of way (and that the &#39;roughness of that is actually pretty smooth) by sheer weight of randomness. There are 5,000 sprites, to which a random acceleration vector is applied (2 random numbers) every frame. That&#39;s 300,000 random numbers being applied to the model every frame. Over the course of the animation, the aggregate velocities of the elements will approach a normal distribution around zero-velocity. (I&#39;m going to let that point dangle and point to <a href="http://en.wikipedia.org/wiki/Central_limit_theorem" rel="nofollow">http://en.wikipedia.org/wiki/Central_limit_theorem</a>).</p>
<p>As you say however, I could implement your (or another &#8211; as well as Mersenne Twister, also consider <a href="http://en.wikipedia.org/wiki/Rule_30" rel="nofollow">http://en.wikipedia.org/wiki/Rule_30</a>) repeatable random seed by creating a random seed in JavaScript and injecting that seed into the two Movies to guarantee that they run in parallel each time a user runs them. It would be a pleasing addition to the test, though I very-much doubt it would change the results. I will add it, if I get the time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shaun</title>
		<link>http://alecmce.com/as3/replacing-enter_frame-testing-tickers/comment-page-1#comment-179</link>
		<dc:creator>shaun</dc:creator>
		<pubDate>Mon, 30 Nov 2009 14:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://alecmce.com/?p=573#comment-179</guid>
		<description>I also wonder if the graphic intensity is throwing off the test results - my CPUs get maxxed out, so perhaps any gain from the frame loop is being negated by the elastic racetrack.</description>
		<content:encoded><![CDATA[<p>I also wonder if the graphic intensity is throwing off the test results &#8211; my CPUs get maxxed out, so perhaps any gain from the frame loop is being negated by the elastic racetrack.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jacksondunstan</title>
		<link>http://alecmce.com/as3/replacing-enter_frame-testing-tickers/comment-page-1#comment-178</link>
		<dc:creator>jacksondunstan</dc:creator>
		<pubDate>Mon, 30 Nov 2009 06:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://alecmce.com/?p=573#comment-178</guid>
		<description>I think the different results you&#039;re seeing may be a result of the heavy use of Math.random(). This is, by nature, introducing a random element into your tests and making them unrepeatable and unverifiable. You might want to try a &lt;a href=&quot;http://jacksondunstan.com/articles/393&quot; rel=&quot;nofollow&quot;&gt;repeatable random&lt;/a&gt; seeded with a constant value in both tests. This allows you to process (virtually) unpredictable numbers and still have some repeatability. Frankly though, I&#039;m not sure why random numbers would be necessary at all. This becomes clearer if you test out other performance paths (like you suggested above), such as those with no graphical elements at all.&lt;br&gt;&lt;br&gt;Thanks for these articles, tests, and the open code. I&#039;m interested to see if all this discussion leads to any measurable performance increase. If it did, I think a lot of AS3 developers would switch their main ENTER_FRAME loops. I know I sure would!</description>
		<content:encoded><![CDATA[<p>I think the different results you&#39;re seeing may be a result of the heavy use of Math.random(). This is, by nature, introducing a random element into your tests and making them unrepeatable and unverifiable. You might want to try a <a href="http://jacksondunstan.com/articles/393" rel="nofollow">repeatable random</a> seeded with a constant value in both tests. This allows you to process (virtually) unpredictable numbers and still have some repeatability. Frankly though, I&#39;m not sure why random numbers would be necessary at all. This becomes clearer if you test out other performance paths (like you suggested above), such as those with no graphical elements at all.</p>
<p>Thanks for these articles, tests, and the open code. I&#39;m interested to see if all this discussion leads to any measurable performance increase. If it did, I think a lot of AS3 developers would switch their main ENTER_FRAME loops. I know I sure would!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
