<?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 for Running with Code</title>
	<atom:link href="http://robpaveza.net/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://robpaveza.net</link>
	<description>Like with scissors, only more dangerous</description>
	<lastBuildDate>Wed, 22 Feb 2012 02:09:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on A Review of Balsamiq Mockups by Brinda</title>
		<link>http://robpaveza.net/a-review-of-balsamiq-mockups/comment-page-1#comment-280</link>
		<dc:creator>Brinda</dc:creator>
		<pubDate>Wed, 22 Feb 2012 02:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/?p=175#comment-280</guid>
		<description>Learn all about Mockuptiger you can host it on your domain, desktop, switch between hand drawn look, change fonts and prototype dashboard mockups with data.</description>
		<content:encoded><![CDATA[<p>Learn all about Mockuptiger you can host it on your domain, desktop, switch between hand drawn look, change fonts and prototype dashboard mockups with data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bridging the gap between Jurassic and the DLR, Part One by Bridging the gap between Jurassic and the DLR, Part Two &#171; Running with Code</title>
		<link>http://robpaveza.net/bridging-the-gap-between-jurassic-and-the-dlr-part-one/comment-page-1#comment-274</link>
		<dc:creator>Bridging the gap between Jurassic and the DLR, Part Two &#171; Running with Code</dc:creator>
		<pubDate>Thu, 16 Feb 2012 07:35:07 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/?p=164#comment-274</guid>
		<description>[...] Part 1: ObjectInstance derives from DynamicObject [...]</description>
		<content:encoded><![CDATA[<p>[...] Part 1: ObjectInstance derives from DynamicObject [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Joining the Jurassic Team by Bridging the gap between Jurassic and the DLR, Part One &#171; Running with Code</title>
		<link>http://robpaveza.net/joining-the-jurassic-team/comment-page-1#comment-272</link>
		<dc:creator>Bridging the gap between Jurassic and the DLR, Part One &#171; Running with Code</dc:creator>
		<pubDate>Tue, 14 Feb 2012 07:50:19 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/joining-the-jurassic-team#comment-272</guid>
		<description>[...] while back I posted that I was joining the Jurassic team; Jurassic is an open-source JavaScript engine for .NET. If you&#8217;ve ever gone through the long [...]</description>
		<content:encoded><![CDATA[<p>[...] while back I posted that I was joining the Jurassic team; Jurassic is an open-source JavaScript engine for .NET. If you&#8217;ve ever gone through the long [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Revealing Prototype Pattern: Pros and Cons by Gene Karasev</title>
		<link>http://robpaveza.net/revealing-prototype-pattern-pros-and-cons/comment-page-1#comment-251</link>
		<dc:creator>Gene Karasev</dc:creator>
		<pubDate>Wed, 25 Jan 2012 19:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/?p=129#comment-251</guid>
		<description>Thank you a lot for the great article!

My way of using Dan&#039;s pattern is to define all public properties (not methods) in the object __pthis:

 function Image(width, height)
    {
        // standard header
        this.__pthis = {};
        var pthis = this.__pthis;
        // end standard header
        //
        pthis.width = width;
        pthis.height = height;
        //
        this.__construct();
    }

And then in a method I can do:
function multiply()
{
        var pthis = this.__pthis; // standard line for all the methods to make __pthis local variable 
        return pthis.width * pthis.height; // example of how to access the properties
}

So I&#039;ve got only one public variable __pthis (except for the public methods) and its easy to remember not to touch it from the outside code.

When I call one method from another method I use myMethod.call(this, arg1, arg2) as Dan recommends, to pass context. For me there&#039;s the only inconvenient thing in that pattern I have to do - using call() method to call my methods. But I have the maximum speed and memory saving (it can be good especially for mobile devices).</description>
		<content:encoded><![CDATA[<p>Thank you a lot for the great article!</p>
<p>My way of using Dan&#8217;s pattern is to define all public properties (not methods) in the object __pthis:</p>
<p> function Image(width, height)<br />
    {<br />
        // standard header<br />
        this.__pthis = {};<br />
        var pthis = this.__pthis;<br />
        // end standard header<br />
        //<br />
        pthis.width = width;<br />
        pthis.height = height;<br />
        //<br />
        this.__construct();<br />
    }</p>
<p>And then in a method I can do:<br />
function multiply()<br />
{<br />
        var pthis = this.__pthis; // standard line for all the methods to make __pthis local variable<br />
        return pthis.width * pthis.height; // example of how to access the properties<br />
}</p>
<p>So I&#8217;ve got only one public variable __pthis (except for the public methods) and its easy to remember not to touch it from the outside code.</p>
<p>When I call one method from another method I use myMethod.call(this, arg1, arg2) as Dan recommends, to pass context. For me there&#8217;s the only inconvenient thing in that pattern I have to do &#8211; using call() method to call my methods. But I have the maximum speed and memory saving (it can be good especially for mobile devices).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Speedy C#, Part 2: Optimizing Memory Allocations &#8211; Pooling and Reusing Objects by Rob Paveza</title>
		<link>http://robpaveza.net/speedy-c-part-2-optimizing-memory-allocations-pooling-and-reusing-objects/comment-page-1#comment-231</link>
		<dc:creator>Rob Paveza</dc:creator>
		<pubDate>Tue, 10 Jan 2012 17:02:05 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/speedy-c-part-2-optimizing-memory-allocations-pooling-and-reusing-objects#comment-231</guid>
		<description>Hi Anders!

I moved your comment to the analogous post here.  Let me take your comment in two parts.

First, regarding my approach: you&#039;re correct - in this case I&#039;m trading memory for speed.  At any given time we may not be utilizing all of the objects in the Pool.  However, I&#039;m circumventing the need to allocate and deallocate these objects, as well as avoiding the need to compact my GC heap.

Regarding the standard API: the scenario I believe you&#039;re proposing is one in which identical (in meaning) objects are being requested, is this correct?  For example, 25 users each ask for the homepage, which causes 25 identical homepage objects to be retrieved and served up?  In this scenario, it is indeed wasteful; there are obviously better ways to cache these data than by using a simple pool without knowledge of the use of the objects.

As with any tool in a programmer&#039;s toolbelt, you have to consider what and how you&#039;re using the tool.  In the case that I&#039;m describing, I needed to allocate byte arrays to later read, all internally, for my API, and then to surface objects that corresponded to these byte arrays.  I allocated the objects that my API produced, but since I never needed to worry about object identity with the byte arrays (use them then get rid of them), it produced a substantial performance benefit to my application.</description>
		<content:encoded><![CDATA[<p>Hi Anders!</p>
<p>I moved your comment to the analogous post here.  Let me take your comment in two parts.</p>
<p>First, regarding my approach: you&#8217;re correct &#8211; in this case I&#8217;m trading memory for speed.  At any given time we may not be utilizing all of the objects in the Pool.  However, I&#8217;m circumventing the need to allocate and deallocate these objects, as well as avoiding the need to compact my GC heap.</p>
<p>Regarding the standard API: the scenario I believe you&#8217;re proposing is one in which identical (in meaning) objects are being requested, is this correct?  For example, 25 users each ask for the homepage, which causes 25 identical homepage objects to be retrieved and served up?  In this scenario, it is indeed wasteful; there are obviously better ways to cache these data than by using a simple pool without knowledge of the use of the objects.</p>
<p>As with any tool in a programmer&#8217;s toolbelt, you have to consider what and how you&#8217;re using the tool.  In the case that I&#8217;m describing, I needed to allocate byte arrays to later read, all internally, for my API, and then to surface objects that corresponded to these byte arrays.  I allocated the objects that my API produced, but since I never needed to worry about object identity with the byte arrays (use them then get rid of them), it produced a substantial performance benefit to my application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Speedy C#, Part 2: Optimizing Memory Allocations &#8211; Pooling and Reusing Objects by Anders Borum</title>
		<link>http://robpaveza.net/speedy-c-part-2-optimizing-memory-allocations-pooling-and-reusing-objects/comment-page-1#comment-230</link>
		<dc:creator>Anders Borum</dc:creator>
		<pubDate>Tue, 10 Jan 2012 10:33:59 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/speedy-c-part-2-optimizing-memory-allocations-pooling-and-reusing-objects#comment-230</guid>
		<description>Hi Rob,

I came across your article (http://robpaveza.net/speedy-c-part-2-optimizing-memory-allocations-pooling-and-reusing-objects) while searching for ways to optimize C# object references and cache eviction algorithms.

I read your article with interest and was wondering about the Pool class. Over the course of the lifetime of the app domain, unless I&#039;m mistaken, you&#039;re trading time released by less GC overhead with increased memory usage (all those pointers in Pool add up).

Imagine a standard API where a large number of threads each query the API for objects (i.e. enumerate hierarchical relations etc.). The Pool would ensure that if one thread at some point had freed an object, it&#039;d be available for other threads to pick up. If you&#039;ve got 25 concurrent threads working, each asking for the same objects (which would be typical in large scale website scenarios - disregarding output caching here), then each object could potentially allocate up to additional 25x space for pointers.

What kind of frequency are we talking about here, that justifies Pool and not just a ConcurrentDictionary?

Thanks in advance,
Anders Borum (Denmark)</description>
		<content:encoded><![CDATA[<p>Hi Rob,</p>
<p>I came across your article (<a href="http://robpaveza.net/speedy-c-part-2-optimizing-memory-allocations-pooling-and-reusing-objects" rel="nofollow">http://robpaveza.net/speedy-c-part-2-optimizing-memory-allocations-pooling-and-reusing-objects</a>) while searching for ways to optimize C# object references and cache eviction algorithms.</p>
<p>I read your article with interest and was wondering about the Pool class. Over the course of the lifetime of the app domain, unless I&#8217;m mistaken, you&#8217;re trading time released by less GC overhead with increased memory usage (all those pointers in Pool add up).</p>
<p>Imagine a standard API where a large number of threads each query the API for objects (i.e. enumerate hierarchical relations etc.). The Pool would ensure that if one thread at some point had freed an object, it&#8217;d be available for other threads to pick up. If you&#8217;ve got 25 concurrent threads working, each asking for the same objects (which would be typical in large scale website scenarios &#8211; disregarding output caching here), then each object could potentially allocate up to additional 25x space for pointers.</p>
<p>What kind of frequency are we talking about here, that justifies Pool and not just a ConcurrentDictionary?</p>
<p>Thanks in advance,<br />
Anders Borum (Denmark)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Defining Variables in JavaScript by Revealing Prototype Pattern: Pros and Cons &#171; Running with Code</title>
		<link>http://robpaveza.net/defining-variables-in-javascript/comment-page-1#comment-229</link>
		<dc:creator>Revealing Prototype Pattern: Pros and Cons &#171; Running with Code</dc:creator>
		<pubDate>Tue, 10 Jan 2012 04:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/?p=127#comment-229</guid>
		<description>[...] short while ago, I wrote a post generally saying good things about the Revealing Prototype Pattern but mostly focused tearing down the other part that was presented with it, namely the way that [...]</description>
		<content:encoded><![CDATA[<p>[...] short while ago, I wrote a post generally saying good things about the Revealing Prototype Pattern but mostly focused tearing down the other part that was presented with it, namely the way that [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Joining the Jurassic Team by Chris Hill</title>
		<link>http://robpaveza.net/joining-the-jurassic-team/comment-page-1#comment-146</link>
		<dc:creator>Chris Hill</dc:creator>
		<pubDate>Sat, 06 Aug 2011 23:15:38 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/joining-the-jurassic-team#comment-146</guid>
		<description>Awesome stuff, Rob! Congrats on joining the team!</description>
		<content:encoded><![CDATA[<p>Awesome stuff, Rob! Congrats on joining the team!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Worries over the Future of the .NET Framework by Sohan</title>
		<link>http://robpaveza.net/worries-over-the-future-of-the-net-framework/comment-page-1#comment-91</link>
		<dc:creator>Sohan</dc:creator>
		<pubDate>Wed, 23 Mar 2011 22:24:35 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/worries-over-the-future-of-the-net-framework#comment-91</guid>
		<description>Just wondering if you are over anxious about the things that looked pretty OK to me.</description>
		<content:encoded><![CDATA[<p>Just wondering if you are over anxious about the things that looked pretty OK to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on My C# 4.0 Wishlist, Part 1 : Eliminate Type Constraint Constraints by Worries over the Future of the .NET Framework &#171; Running with Code</title>
		<link>http://robpaveza.net/my-c-4-0-wishlist-part-1-eliminate-type-constraint-constraints/comment-page-1#comment-89</link>
		<dc:creator>Worries over the Future of the .NET Framework &#171; Running with Code</dc:creator>
		<pubDate>Wed, 23 Mar 2011 05:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://robpaveza.net/my-c-4-0-wishlist-part-1-eliminate-type-constraint-constraints#comment-89</guid>
		<description>[...] long while ago, I talked about the limitation of generics in that they may not support certain types as type parameter constraints, in that article specifically, enumeration types.&#160; Enumeration types would give you similar [...]</description>
		<content:encoded><![CDATA[<p>[...] long while ago, I talked about the limitation of generics in that they may not support certain types as type parameter constraints, in that article specifically, enumeration types.&#160; Enumeration types would give you similar [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

