<?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: Strongly typed objects and collections vs. performance</title>
	<atom:link href="http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/</link>
	<description></description>
	<lastBuildDate>Fri, 07 Oct 2011 15:08:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: fake rolex watches</title>
		<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/comment-page-1/#comment-214447</link>
		<dc:creator>fake rolex watches</dc:creator>
		<pubDate>Wed, 24 Aug 2011 07:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/archives/2004/04/13/strongly-typed-objects-and-collections-vs-performance/#comment-214447</guid>
		<description>As the business grows, &lt;a href=&quot;http://www.erowatch.com&quot; rel=&quot;nofollow&quot;&gt;rolex replicas&lt;/a&gt; has also jumped into an international brand. It is worth mentioning that,&lt;a href=&quot;http://www.erowatch.com&quot; rel=&quot;nofollow&quot;&gt;replica rolex watches&lt;/a&gt; is the ancestor of today&#039;s brand-oriented, in order to protect the quality and brand name will be printed on their products, the history of fashion in the world, is the first one first.&lt;a href=&quot;http://www.erowatch.com&quot; rel=&quot;nofollow&quot;&gt;rolex replica watches&lt;/a&gt;, &lt;a href=&quot;http://www.erowatch.com&quot; rel=&quot;nofollow&quot;&gt;fake rolex&lt;/a&gt;,  &lt;a href=&quot;http://www.erowatch.com&quot; rel=&quot;nofollow&quot;&gt;fake rolex watches&lt;/a&gt; .&lt;a href=&quot;http://www.erowatch.com/9-omega-watches&quot; rel=&quot;nofollow&quot;&gt;fake omega watches&lt;/a&gt;
&lt;a href=&quot;http://www.erowatch.com/9-omega-watches&quot; rel=&quot;nofollow&quot;&gt;replica omega watches&lt;/a&gt;
&lt;a href=&quot;http://www.erowatch.com/10-tag-heuer-watches&quot; rel=&quot;nofollow&quot;&gt;tag heuer replica watches&lt;/a&gt;
&lt;a href=&quot;http://www.erowatch.com/10-tag-heuer-watches&quot; rel=&quot;nofollow&quot;&gt;tag heuer watches&lt;/a&gt;.http://www.erowatch.com</description>
		<content:encoded><![CDATA[<p>As the business grows, <a href="http://www.erowatch.com" rel="nofollow">rolex replicas</a> has also jumped into an international brand. It is worth mentioning that,<a href="http://www.erowatch.com" rel="nofollow">replica rolex watches</a> is the ancestor of today&#8217;s brand-oriented, in order to protect the quality and brand name will be printed on their products, the history of fashion in the world, is the first one first.<a href="http://www.erowatch.com" rel="nofollow">rolex replica watches</a>, <a href="http://www.erowatch.com" rel="nofollow">fake rolex</a>,  <a href="http://www.erowatch.com" rel="nofollow">fake rolex watches</a> .<a href="http://www.erowatch.com/9-omega-watches" rel="nofollow">fake omega watches</a><br />
<a href="http://www.erowatch.com/9-omega-watches" rel="nofollow">replica omega watches</a><br />
<a href="http://www.erowatch.com/10-tag-heuer-watches" rel="nofollow">tag heuer replica watches</a><br />
<a href="http://www.erowatch.com/10-tag-heuer-watches" rel="nofollow">tag heuer watches</a>.<a href="http://www.erowatch.com" rel="nofollow">http://www.erowatch.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strongly - StartTags.com</title>
		<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/comment-page-1/#comment-199677</link>
		<dc:creator>strongly - StartTags.com</dc:creator>
		<pubDate>Tue, 26 Jan 2010 23:44:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/archives/2004/04/13/strongly-typed-objects-and-collections-vs-performance/#comment-199677</guid>
		<description>[...] ... We now look for evidence for X of a certain type. Suppose that there is a probablity q ...Strongly typed objects and collections vs. performance ...Strongly Typed Objects - I&#039;ve lost a battle, but will win the war. Plip, whom I&#039;ve never met but [...]</description>
		<content:encoded><![CDATA[<p>[...] &#8230; We now look for evidence for X of a certain type. Suppose that there is a probablity q &#8230;Strongly typed objects and collections vs. performance &#8230;Strongly Typed Objects &#8211; I&#39;ve lost a battle, but will win the war. Plip, whom I&#39;ve never met but [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lazycoder weblog &#187; Udi on strongly typed collections</title>
		<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/comment-page-1/#comment-33</link>
		<dc:creator>Lazycoder weblog &#187; Udi on strongly typed collections</dc:creator>
		<pubDate>Tue, 20 Apr 2004 13:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/archives/2004/04/13/strongly-typed-objects-and-collections-vs-performance/#comment-33</guid>
		<description>[...] ee, then I have to cache each collection seperately.  	I explain myself a little better in &lt;a href=&quot;http://www.lazycoder.com/weblog/index.php?p=51#comment-31&quot;&gt;this comment.&lt;/a&gt;  	 	 	 		  		Comments (0)  	 	 	     Comments  RSS feed for comm [...]</description>
		<content:encoded><![CDATA[<p>[...] ee, then I have to cache each collection seperately.  	I explain myself a little better in <a href="http://www.lazycoder.com/weblog/index.php?p=51#comment-31">this comment.</a>  	</p>
<p> 		Comments (0) </p>
<p>    Comments  <acronym title='Rich Site Summary'><span class='caps'>RSS</span></acronym> feed for comm [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/comment-page-1/#comment-32</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 14 Apr 2004 15:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/archives/2004/04/13/strongly-typed-objects-and-collections-vs-performance/#comment-32</guid>
		<description>Karl,
Yeah the size will be a problem but not if I can cache all of the possible objects individually within the applications scope. Since classes are all reference types I&#039;m just passing around copies of references when I pass them into methods or retrieve them from the cache. Say two of my users both have access to patient #12, I create the patient object for #12 once and cache it. Whenever any of my users want to work on patient #12 I retrieve the object from the cache. I can create the cache at application startup, and add or remove from it during the life of the application as I see fit, which creates a lot of overhead when I start the application up but removes during the important part, when the users are using it. That brings in a lot of other threading and locking issues though.

By creating a strongly typed collection of objects specific to the user and caching that I end up with redundant objects... I think. My understanding is that if I create an object during a page_load event, and I have two separate users load the page and create a new patient object for user #12 I end up with two separate copies of the patient object. Ideally, if I wanted to use strongly typed collections, I&#039;d create one that allowed me create a subset (e.g. PatientList patientList.selectPatients(int[] PatientIDs)) and cache a list of ALL the patients in the database. The tricky thing about that is I have to be mindful of updates,deletions,and additions of patients and make sure to sync the cache after any of those events. Which adds enough overhead to the operations that it probably outweighs the benefits of caching the data in the first place!

I had this same discussion with Java guys back when I was doing some JSP work. If you do everything in a very OOP manner you end up with hundreds and thousands of objects sitting around in memory waiting to get GC&#039;d that may or may not get used. .NET doesn&#039;t really have a robust object management system for caching,locking, and all that yet like J2EE does. We have to write all that code ourselves. I&#039;m really, really waiting for Microsoft, or someone, to come out with a JBoss type server.</description>
		<content:encoded><![CDATA[<p>Karl,<br />
Yeah the size will be a problem but not if I can cache all of the possible objects individually within the applications scope. Since classes are all reference types I&#8217;m just passing around copies of references when I pass them into methods or retrieve them from the cache. Say two of my users both have access to patient #12, I create the patient object for #12 once and cache it. Whenever any of my users want to work on patient #12 I retrieve the object from the cache. I can create the cache at application startup, and add or remove from it during the life of the application as I see fit, which creates a lot of overhead when I start the application up but removes during the important part, when the users are using it. That brings in a lot of other threading and locking issues though.</p>
<p>By creating a strongly typed collection of objects specific to the user and caching that I end up with redundant objects&#8230; I think. My understanding is that if I create an object during a page_load event, and I have two separate users load the page and create a new patient object for user #12 I end up with two separate copies of the patient object. Ideally, if I wanted to use strongly typed collections, I&#8217;d create one that allowed me create a subset (e.g. PatientList patientList.selectPatients(int[] PatientIDs)) and cache a list of ALL the patients in the database. The tricky thing about that is I have to be mindful of updates,deletions,and additions of patients and make sure to sync the cache after any of those events. Which adds enough overhead to the operations that it probably outweighs the benefits of caching the data in the first place!</p>
<p>I had this same discussion with Java guys back when I was doing some <acronym title='Java Server Pages'><span class='caps'>JSP</span></acronym> work. If you do everything in a very <acronym title='Object Oriented Programming'><span class='caps'>OOP</span></acronym> manner you end up with hundreds and thousands of objects sitting around in memory waiting to get GC&#8217;d that may or may not get used. .NET doesn&#8217;t really have a robust object management system for caching,locking, and all that yet like <acronym title='Java2 Enterprise Edition'><span class='caps'>J2EE</span></acronym> does. We have to write all that code ourselves. I&#8217;m really, really waiting for Microsoft, or someone, to come out with a JBoss type server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/comment-page-1/#comment-31</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 14 Apr 2004 15:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/archives/2004/04/13/strongly-typed-objects-and-collections-vs-performance/#comment-31</guid>
		<description>Phil,
That&#039;s essentially what I&#039;m doing now. Just retrieving the items I need. Right now I&#039;m just using a DataReader or a DataSet, depending on the result set size and what I want to do with the data once it gets down to the client. To use a strongly typed collection I have to create new classes representing sub-sets of the patients data that I need for a particular interface. E.g. The the patient&#039;s name and id for one class, perhaps their name, id and primary care physician in another. I still need to create the dataset/dataReader and populate those classes so I&#039;m not really saving any work or lowering the overhead; In fact I&#039;m creating more work for my middle tier and decreasing the performance by creating the DataSet/DataReader and then creating a new object to hold the contents of each row of the DataSet/DataReader. Unless I set up a very elaborate caching scheme to cache the individual objects and share them across the user boundries I have to do this on each page load for each user. I could cache a Patient object for every patient in the database, we&#039;re adding about 40 new patients a week. Pretty soon we&#039;ll be talking about some real numbers at that rate. That&#039;s just for the patients, each patient row in the database has multiple lab rows associated with it, somewhere around 500-2500 rows per patient, multiple medications, multiple physicians, appointments, etc... The overhead of caching all of these strongly typed collections would be enormous.

In the case of large result sets I think that the scenario with the best performance is probably using a DataReader to populate the list (e.g. DataRepeater, DataGrid, DataList) and then creating the strongly typed object for the item when it is selected (e.g. the user clicks on a hyperlink and a new &quot;Patient&quot; object is created and populated. I will be doing some tests on strongly typed collections of both value and reference types to see what the overhead is, if any.

I think in a WinForms application, where you have a concept of &quot;State&quot;, strongly typed collections work great.</description>
		<content:encoded><![CDATA[<p>Phil,<br />
That&#8217;s essentially what I&#8217;m doing now. Just retrieving the items I need. Right now I&#8217;m just using a DataReader or a DataSet, depending on the result set size and what I want to do with the data once it gets down to the client. To use a strongly typed collection I have to create new classes representing sub-sets of the patients data that I need for a particular interface. E.g. The the patient&#8217;s name and id for one class, perhaps their name, id and primary care physician in another. I still need to create the dataset/dataReader and populate those classes so I&#8217;m not really saving any work or lowering the overhead; In fact I&#8217;m creating more work for my middle tier and decreasing the performance by creating the DataSet/DataReader and then creating a new object to hold the contents of each row of the DataSet/DataReader. Unless I set up a very elaborate caching scheme to cache the individual objects and share them across the user boundries I have to do this on each page load for each user. I could cache a Patient object for every patient in the database, we&#8217;re adding about 40 new patients a week. Pretty soon we&#8217;ll be talking about some real numbers at that rate. That&#8217;s just for the patients, each patient row in the database has multiple lab rows associated with it, somewhere around 500-2500 rows per patient, multiple medications, multiple physicians, appointments, etc&#8230; The overhead of caching all of these strongly typed collections would be enormous.</p>
<p>In the case of large result sets I think that the scenario with the best performance is probably using a DataReader to populate the list (e.g. DataRepeater, DataGrid, DataList) and then creating the strongly typed object for the item when it is selected (e.g. the user clicks on a hyperlink and a new &#8220;Patient&#8221; object is created and populated. I will be doing some tests on strongly typed collections of both value and reference types to see what the overhead is, if any.</p>
<p>I think in a WinForms application, where you have a concept of &#8220;State&#8221;, strongly typed collections work great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: karl</title>
		<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/comment-page-1/#comment-30</link>
		<dc:creator>karl</dc:creator>
		<pubDate>Wed, 14 Apr 2004 12:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/archives/2004/04/13/strongly-typed-objects-and-collections-vs-performance/#comment-30</guid>
		<description>Perhaps I&#039;m missing something (wow, I&#039;ve started a lot of blog comments like that today....ughhh), but if you are gonna cache the data, won&#039;t size be a problem reguardless of whether its in a custom collection or a Dataset.  I&#039;d actually think the custom collection would have less overhead.

If you aren&#039;t caching them, either way you are you either have to repopulate a dataset, or a collection of objects from a datareader..I wouldn&#039;t guess which would be worse.

What we&#039;ve discovered from our own data is a 20/80 rule..where 20% of records are used 80% of the time.  In other words simply caching [the best] ~500 patients would probably be ideal.</description>
		<content:encoded><![CDATA[<p>Perhaps I&#8217;m missing something (wow, I&#8217;ve started a lot of blog comments like that today&#8230;.ughhh), but if you are gonna cache the data, won&#8217;t size be a problem reguardless of whether its in a custom collection or a Dataset.  I&#8217;d actually think the custom collection would have less overhead.</p>
<p>If you aren&#8217;t caching them, either way you are you either have to repopulate a dataset, or a collection of objects from a datareader..I wouldn&#8217;t guess which would be worse.</p>
<p>What we&#8217;ve discovered from our own data is a 20/80 rule..where 20% of records are used 80% of the time.  In other words simply caching [the best] ~500 patients would probably be ideal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Winstanley</title>
		<link>http://www.lazycoder.com/weblog/2004/04/13/strongly-typed-objects-and-collections-vs-performance/comment-page-1/#comment-29</link>
		<dc:creator>Phil Winstanley</dc:creator>
		<pubDate>Wed, 14 Apr 2004 07:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/archives/2004/04/13/strongly-typed-objects-and-collections-vs-performance/#comment-29</guid>
		<description>I&#039;m sorry that you had to endure Wally sulking after his team was annihilated ;)

With Large collections the system becomes ... interesting, I&#039;ve not spent enough time optimizing my stuff to be able to tell you about the sizes of the objects and in memory stuff whereby things get slow. 

In reality all you&#039;re dealing with at ArrayLists so if you find some performance metrics on them, you should have something pretty close.

In my opinion if you have x thousand entries, do they really need to be in memory or can you get away with just the items you need to have? Can you rework your queries to cut down on size, or only half populate your objects, if you just need Patient Name an Id, just populate those items.

I&#039;d love to run some perf tests but doubt I&#039;ll have the time soon.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry that you had to endure Wally sulking after his team was annihilated <img src='http://www.lazycoder.com/weblog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>With Large collections the system becomes &#8230; interesting, I&#8217;ve not spent enough time optimizing my stuff to be able to tell you about the sizes of the objects and in memory stuff whereby things get slow. </p>
<p>In reality all you&#8217;re dealing with at ArrayLists so if you find some performance metrics on them, you should have something pretty close.</p>
<p>In my opinion if you have x thousand entries, do they really need to be in memory or can you get away with just the items you need to have? Can you rework your queries to cut down on size, or only half populate your objects, if you just need Patient Name an Id, just populate those items.</p>
<p>I&#8217;d love to run some perf tests but doubt I&#8217;ll have the time soon.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

