<?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: JavaScript Inheritance Performance</title>
	<atom:link href="http://www.broofa.com/2009/02/javascript-inheritance-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/</link>
	<description>(Thoughtful musings, if you&#039;re lucky)</description>
	<lastBuildDate>Tue, 20 Jul 2010 16:43:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Michael .H</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-2086</link>
		<dc:creator>Michael .H</dc:creator>
		<pubDate>Sun, 13 Dec 2009 10:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-2086</guid>
		<description>@Oleg On my IE8 and FF 3.5 (Windows based) it did not performed as better as Dojo and Base2</description>
		<content:encoded><![CDATA[<p>@Oleg On my IE8 and FF 3.5 (Windows based) it did not performed as better as Dojo and Base2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Slobodskoi</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-2072</link>
		<dc:creator>Oleg Slobodskoi</dc:creator>
		<pubDate>Fri, 11 Dec 2009 15:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-2072</guid>
		<description>well, here are results on my mac and FF 3.5.5:
My implementaion:
http://tinyurl.com/yeer83v
Dojo:
http://tinyurl.com/y9sykqd
Base:
http://tinyurl.com/yb47245
J3Class2:
http://tinyurl.com/yaphcyw

It variates from time to time, but if I test some rounds I see appr. this results. 

@Michael .H you not?</description>
		<content:encoded><![CDATA[<p>well, here are results on my mac and FF 3.5.5:<br />
My implementaion:<br />
<a href="http://tinyurl.com/yeer83v" rel="nofollow">http://tinyurl.com/yeer83v</a><br />
Dojo:<br />
<a href="http://tinyurl.com/y9sykqd" rel="nofollow">http://tinyurl.com/y9sykqd</a><br />
Base:<br />
<a href="http://tinyurl.com/yb47245" rel="nofollow">http://tinyurl.com/yb47245</a><br />
J3Class2:<br />
<a href="http://tinyurl.com/yaphcyw" rel="nofollow">http://tinyurl.com/yaphcyw</a></p>
<p>It variates from time to time, but if I test some rounds I see appr. this results. </p>
<p>@Michael .H you not?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael .H</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-2070</link>
		<dc:creator>Michael .H</dc:creator>
		<pubDate>Fri, 11 Dec 2009 12:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-2070</guid>
		<description>@Oleg Slobodskoi from your tests it results that is not faster than Base2 and Dojo. Whith what other implementations did you compared?</description>
		<content:encoded><![CDATA[<p>@Oleg Slobodskoi from your tests it results that is not faster than Base2 and Dojo. Whith what other implementations did you compared?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Slobodskoi</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-2025</link>
		<dc:creator>Oleg Slobodskoi</dc:creator>
		<pubDate>Sun, 15 Nov 2009 18:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-2025</guid>
		<description>Hello guys.
I have also wrote one classical iheritance implementation :) There is a lot of them, I know, but I like my way more :)

The most important points of my implementation are:

1. User will work with constructor to create a class, not with object - private class variables and functions are possible.
2. I think at the moment when browser rendering any constructor it hasn&#039;t to initialize all the stuff the constructor contains
3. I can use more classical order pattern inside of the constructor. (first private variables, then privileged, then public methods and then private methods)
4. access overwritten methods via _super
5. Pass any variables to constructor, so they can be used everywere in the class, without to have to map over them, like if you do it over init method


Speedtest shows that my implementation is slower than j3Class or wr Class, but it still much faster than all other famous implementations.

Probably you have some Ideas how I can impove the performance without to change the usability?

http://dev.ajaxsoft.de/classtest/</description>
		<content:encoded><![CDATA[<p>Hello guys.<br />
I have also wrote one classical iheritance implementation <img src='http://www.broofa.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  There is a lot of them, I know, but I like my way more <img src='http://www.broofa.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The most important points of my implementation are:</p>
<p>1. User will work with constructor to create a class, not with object &#8211; private class variables and functions are possible.<br />
2. I think at the moment when browser rendering any constructor it hasn&#8217;t to initialize all the stuff the constructor contains<br />
3. I can use more classical order pattern inside of the constructor. (first private variables, then privileged, then public methods and then private methods)<br />
4. access overwritten methods via _super<br />
5. Pass any variables to constructor, so they can be used everywere in the class, without to have to map over them, like if you do it over init method</p>
<p>Speedtest shows that my implementation is slower than j3Class or wr Class, but it still much faster than all other famous implementations.</p>
<p>Probably you have some Ideas how I can impove the performance without to change the usability?</p>
<p><a href="http://dev.ajaxsoft.de/classtest/" rel="nofollow">http://dev.ajaxsoft.de/classtest/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hokaoiwgrnvw</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-1878</link>
		<dc:creator>hokaoiwgrnvw</dc:creator>
		<pubDate>Tue, 06 Oct 2009 00:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-1878</guid>
		<description>nmishbektjjs</description>
		<content:encoded><![CDATA[<p>nmishbektjjs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-1862</link>
		<dc:creator>Stefan</dc:creator>
		<pubDate>Wed, 30 Sep 2009 23:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-1862</guid>
		<description>Just FYI, using tinyurls in an image src is not a good idea. Some people (like me) have a preference cookie from tinyurl.com, which will load the redirect page at preview.tinyurl.com instead of redirecting to the original URL. The redirect page is HTML, and so the images in your benchmark won&#039;t show up.</description>
		<content:encoded><![CDATA[<p>Just FYI, using tinyurls in an image src is not a good idea. Some people (like me) have a preference cookie from tinyurl.com, which will load the redirect page at preview.tinyurl.com instead of redirecting to the original URL. The redirect page is HTML, and so the images in your benchmark won&#8217;t show up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clean JavaScript inheritance</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-1830</link>
		<dc:creator>Clean JavaScript inheritance</dc:creator>
		<pubDate>Wed, 26 Aug 2009 17:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-1830</guid>
		<description>[...] I found a great article that compares inheritance performance of different libraries, here are results with directly called parent method approach ( using vClass [...]</description>
		<content:encoded><![CDATA[<p>[...] I found a great article that compares inheritance performance of different libraries, here are results with directly called parent method approach ( using vClass [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Javascript Inheritance benchmarks, redux &#171; Warfangled</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-1637</link>
		<dc:creator>Javascript Inheritance benchmarks, redux &#171; Warfangled</dc:creator>
		<pubDate>Fri, 27 Mar 2009 15:12:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-1637</guid>
		<description>[...] The tests labeled Parasitic are using the JavaScript Inheritance method outlined in my previous post. The other labels are described originally at Broofa.com&#8217;s article on Javascript inheritance performance: [...]</description>
		<content:encoded><![CDATA[<p>[...] The tests labeled Parasitic are using the JavaScript Inheritance method outlined in my previous post. The other labels are described originally at Broofa.com&#8217;s article on Javascript inheritance performance: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Broofa</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-1607</link>
		<dc:creator>Broofa</dc:creator>
		<pubDate>Fri, 20 Mar 2009 12:04:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-1607</guid>
		<description>@Jonathan - I would hardly describe needing to invoke a parent method implementation as, &quot;convoluted&quot;.  It&#039;s a tried and true pattern that is ubiquitous in other languages.  And a classic method for providing code reuse.

One problem with parasitic inheritance is that it doesn&#039;t provide a simple way for subclasses to inject behavior into super classes.  For example, if a subclass needs to add a &quot;onAfterFoo&quot; callback to the foo() method of a superclass, how is that accomplished with parasitic inheritance?

With classic inheritance, the subclass need only define a foo() method that looks something like this:

  function() {
    this.parent.foo();
    this.onAfterFoo();
  }


But with parasitic inheritance you have to cobble together some way of preserving a reference to the parent implementation before overriding the foo() method.  And, to date, I have yet to see an elegant solution to that problem that doesn&#039;t look a lot like the classic inheritance solutions you feel are wrong.</description>
		<content:encoded><![CDATA[<p>@Jonathan &#8211; I would hardly describe needing to invoke a parent method implementation as, &#8220;convoluted&#8221;.  It&#8217;s a tried and true pattern that is ubiquitous in other languages.  And a classic method for providing code reuse.</p>
<p>One problem with parasitic inheritance is that it doesn&#8217;t provide a simple way for subclasses to inject behavior into super classes.  For example, if a subclass needs to add a &#8220;onAfterFoo&#8221; callback to the foo() method of a superclass, how is that accomplished with parasitic inheritance?</p>
<p>With classic inheritance, the subclass need only define a foo() method that looks something like this:</p>
<p>  function() {<br />
    this.parent.foo();<br />
    this.onAfterFoo();<br />
  }</p>
<p>But with parasitic inheritance you have to cobble together some way of preserving a reference to the parent implementation before overriding the foo() method.  And, to date, I have yet to see an elegant solution to that problem that doesn&#8217;t look a lot like the classic inheritance solutions you feel are wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://www.broofa.com/2009/02/javascript-inheritance-performance/comment-page-1/#comment-1606</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Fri, 20 Mar 2009 01:55:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.broofa.com/blog/?p=237#comment-1606</guid>
		<description>I&#039;m sitting here wondering why you would ever want to call a parent&#039;s method from within an overriding method. It seems like if you need to do something that convoluted, you&#039;re doing something wrong. 

I&#039;d rather use the method Doug Crockford outlines as parasitic inheritance. You can&#039;t call a parent method from within an overriding method, it&#039;s a little slower on instantiation, but runs par with parent method invocation. It also makes for much cleaner code, being able to pass parameters into the parent class creation, and allowing for private members via closures.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sitting here wondering why you would ever want to call a parent&#8217;s method from within an overriding method. It seems like if you need to do something that convoluted, you&#8217;re doing something wrong. </p>
<p>I&#8217;d rather use the method Doug Crockford outlines as parasitic inheritance. You can&#8217;t call a parent method from within an overriding method, it&#8217;s a little slower on instantiation, but runs par with parent method invocation. It also makes for much cleaner code, being able to pass parameters into the parent class creation, and allowing for private members via closures.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
