<?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: Constructor Slowdown?</title>
	<atom:link href="http://jacksondunstan.com/articles/276/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com/articles/276</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: jackson</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-1729</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 24 Nov 2010 01:50:47 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-1729</guid>
		<description>I always test with a release build in a release version of the Flash Player browser plugin. Debug performance is almost always vastly slower and, frankly, irrelevant since end users are almost never running the debug version.</description>
		<content:encoded><![CDATA[<p>I always test with a release build in a release version of the Flash Player browser plugin. Debug performance is almost always vastly slower and, frankly, irrelevant since end users are almost never running the debug version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Mclean</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-1728</link>
		<dc:creator>Justin Mclean</dc:creator>
		<pubDate>Wed, 24 Nov 2010 01:37:15 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-1728</guid>
		<description>Did you run the tests as a release compile in the release version (ie non debug) of the Flash Player? If you do I think you will find there is a difference - that&#039;s been my experience anyway.</description>
		<content:encoded><![CDATA[<p>Did you run the tests as a release compile in the release version (ie non debug) of the Flash Player? If you do I think you will find there is a difference &#8211; that&#8217;s been my experience anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-1727</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 24 Nov 2010 01:28:48 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-1727</guid>
		<description>There&#039;s definitely a chance that it&#039;s just hard to come up with an example where constructors are slower than other functions, but it&#039;d be really good to know if there are cases where constructors actually are slower. Let me know what you find out once you&#039;ve got a chance to dig in.</description>
		<content:encoded><![CDATA[<p>There&#8217;s definitely a chance that it&#8217;s just hard to come up with an example where constructors are slower than other functions, but it&#8217;d be really good to know if there are cases where constructors actually are slower. Let me know what you find out once you&#8217;ve got a chance to dig in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manu</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-1726</link>
		<dc:creator>manu</dc:creator>
		<pubDate>Wed, 24 Nov 2010 01:21:32 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-1726</guid>
		<description>I agree with you and am still am looking for a &quot;constructor&quot; slowdown example... WIth AS3 everything is jitted except for $cinit and $init functions which are not constructors that are called everytime you create a new object. So I have not seen any slowdowns like what this other person claims in the link below in real example :(

I am waiting for my copy of Visual Studio 8 to arrive pretty soon so that I can compile tamarin and dig into the object creation sequence in the VM....

http://blog.classsoftware.com/index.cfm/2010/11/4/Heavy-constructor-JIT-optimisation-in-ActionScript#c33099700-D56E-59C1-07EACFF9ED89BF3A</description>
		<content:encoded><![CDATA[<p>I agree with you and am still am looking for a &#8220;constructor&#8221; slowdown example&#8230; WIth AS3 everything is jitted except for $cinit and $init functions which are not constructors that are called everytime you create a new object. So I have not seen any slowdowns like what this other person claims in the link below in real example :(</p>
<p>I am waiting for my copy of Visual Studio 8 to arrive pretty soon so that I can compile tamarin and dig into the object creation sequence in the VM&#8230;.</p>
<p><a href="http://blog.classsoftware.com/index.cfm/2010/11/4/Heavy-constructor-JIT-optimisation-in-ActionScript#c33099700-D56E-59C1-07EACFF9ED89BF3A" rel="nofollow">http://blog.classsoftware.com/index.cfm/2010/11/4/Heavy-constructor-JIT-optimisation-in-ActionScript#c33099700-D56E-59C1-07EACFF9ED89BF3A</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bwhiting</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-970</link>
		<dc:creator>bwhiting</dc:creator>
		<pubDate>Wed, 20 Oct 2010 11:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-970</guid>
		<description>I wrote this a wee while ago but never posted it being lazy
http://blog.bwhiting.co.uk/?p=69

but now I have, maybe of interest to you to see what is going on under the hood.</description>
		<content:encoded><![CDATA[<p>I wrote this a wee while ago but never posted it being lazy<br />
<a href="http://blog.bwhiting.co.uk/?p=69" rel="nofollow">http://blog.bwhiting.co.uk/?p=69</a></p>
<p>but now I have, maybe of interest to you to see what is going on under the hood.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-828</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 15 Sep 2010 19:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-828</guid>
		<description>I never run my performance tests in the content debugging player. The point of the article is to debunk the myth that-- for whatever reason-- code in a constructor executes slower than code outside of a constructor.</description>
		<content:encoded><![CDATA[<p>I never run my performance tests in the content debugging player. The point of the article is to debunk the myth that&#8211; for whatever reason&#8211; code in a constructor executes slower than code outside of a constructor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henke37</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-827</link>
		<dc:creator>Henke37</dc:creator>
		<pubDate>Wed, 15 Sep 2010 19:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-827</guid>
		<description>I think the issue is simple: constructors are interpreted instead of JITed. But the content debugging players doesn&#039;t use JITing apparently. So the test is flawed, assuming that it was run in a content debugging player.</description>
		<content:encoded><![CDATA[<p>I think the issue is simple: constructors are interpreted instead of JITed. But the content debugging players doesn&#8217;t use JITing apparently. So the test is flawed, assuming that it was run in a content debugging player.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-20</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 16 Sep 2009 19:12:33 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-20</guid>
		<description>Thanks for the comment. The point of the article was to show that there is no performance gain or loss either way. It simply doesn&#039;t matter if the code is in the constructor or an init() function. I did try a few other types of constructors, including some making calls to more native-heavy code like Math.sqrt(), and saw no difference, so I posed just this.

I agree about when to use init() over constructors. Object re-use is a big deal when trying to eliminate GC slowdown and allocation time. It also allows free lists, as today&#039;s article points out. Personally, I like to do just as much in the constructor as is necessary for the object to be constructed in a valid, known state, per the RAII approach. Then the user should call init() or other functions to further set up the object as required.

Thanks again for the comment.</description>
		<content:encoded><![CDATA[<p>Thanks for the comment. The point of the article was to show that there is no performance gain or loss either way. It simply doesn&#8217;t matter if the code is in the constructor or an init() function. I did try a few other types of constructors, including some making calls to more native-heavy code like Math.sqrt(), and saw no difference, so I posed just this.</p>
<p>I agree about when to use init() over constructors. Object re-use is a big deal when trying to eliminate GC slowdown and allocation time. It also allows free lists, as today&#8217;s article points out. Personally, I like to do just as much in the constructor as is necessary for the object to be constructed in a valid, known state, per the RAII approach. Then the user should call init() or other functions to further set up the object as required.</p>
<p>Thanks again for the comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alec McEachran</title>
		<link>http://jacksondunstan.com/articles/276/comment-page-1#comment-19</link>
		<dc:creator>Alec McEachran</dc:creator>
		<pubDate>Wed, 16 Sep 2009 19:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=276#comment-19</guid>
		<description>Thanks for the interesting article.

I&#039;m not sure you can call that a performance improvement because the margin of error is so slim; you&#039;d need a much bigger sample of constructors to have any confidence.

As a performance-irrelevant aside, I have two reasons to favour init over the constructor:

1. You can call super.init(...) from anywhere in a sub-class&#039;s init method;

2. Once you construct a super-class with parameters the compiler commits you to writing out that constructor for any sub-class.

They&#039;re good enough to prefer init over the constructor when no other overriding reason presents itself, in my opinion.

Regards, Alec.</description>
		<content:encoded><![CDATA[<p>Thanks for the interesting article.</p>
<p>I&#8217;m not sure you can call that a performance improvement because the margin of error is so slim; you&#8217;d need a much bigger sample of constructors to have any confidence.</p>
<p>As a performance-irrelevant aside, I have two reasons to favour init over the constructor:</p>
<p>1. You can call super.init(&#8230;) from anywhere in a sub-class&#8217;s init method;</p>
<p>2. Once you construct a super-class with parameters the compiler commits you to writing out that constructor for any sub-class.</p>
<p>They&#8217;re good enough to prefer init over the constructor when no other overriding reason presents itself, in my opinion.</p>
<p>Regards, Alec.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

