Thanks again to everyone who attended my LINQ on Mobile Devices Webcast today – If you missed it, the webcast is available for On-Demand viewing starting tomorrow (Thursday, 28-February-2008).
First let me apologize for the difficulty in showing the screenshots of the CLR Profiler output. But the good news is… the screenshots are visible here. J
As a reminder, these two screenshots show the overhead of having to load SQL Server Compact (SSC) tables into a DataSet to be able to query the table contents with LINQ as opposed to using LINQ to query directly against the database tables through a SqlCeResultSet.
Memory Statistics when Using a DataSet

Memory Statistics when Using a ResultSet

These shouldn't be a huge surprise, but they really do reinforce the cost of using DataSets on a mobile device. Notice that not only does the SqlCeResultSet version have a final heap size that is nearly 85% smaller than that of the DataSet version. But the SqlCeResultSet version incurs only a single Garbage Collection compared to 4 Garbage Collections for the DataSet version.
These differences in memory and GCs map to real differences in application performance, resource consumption and power usage. Keep in mind, that the NorthWind database that these examples use is only moderate in size by real-life standards. As data volumes grow, these differences can become much greater.
Custom Extension Method & Enumerator Performance

This chart shows how much we were able to improve the performance of querying against the SqlCeResultSet directly through the use of a very simple custom Where extension method along with the introduction of a smart custom enumerator.
Sample Downloads
And finally, here are the downloads for the various code samples shown during the webcast
- First demo – Shows how the difference in LINQ-based method support affects the behavior of the LINQ language syntax
- Second demo – Shows the time and resource cost of using a DataSet as compared to a SqlCeResultSet (goes with the first 2 screenshots)
- Third demo – Shows the benefit of using a custom extension methods and enumerators to query the SSC database tables directly (goes with the above chart)
(VB Samples are available on this post)
Thanks again – if you have any questions, feel free to ask them here. I do my best to respond to as many as I can.
(View Webcast On-Demand)
Posted
Feb 27 2008, 03:33 PM
by
jim-wilson