<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>In-Memory Query with C#2.0 and C#3.0</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx</link><description>Here's some sample code from a demo I did a few months ago. It's a simple example of how much easier in-memory query and transformation are with C#3.0 and LINQ, compared with a straightforward implementation using C#2.0. The Query The goal is to implement</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Why In Memory Query with C# 3.0 is Easier than in C# 2.0</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#2058338</link><pubDate>Mon, 09 Apr 2007 09:24:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2058338</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You've been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
</description></item><item><title>Community Convergence XXIV</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#2058419</link><pubDate>Mon, 09 Apr 2007 09:41:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2058419</guid><dc:creator>Charlie Calvert's Community Blog</dc:creator><description>&lt;p&gt;Recently my time has been taken up with a series of internal issues involving Beta1, C# Samples and various&lt;/p&gt;
</description></item><item><title>re: In-Memory Query with C#2.0 and C#3.0</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#2171245</link><pubDate>Wed, 18 Apr 2007 11:33:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2171245</guid><dc:creator>ElDog</dc:creator><description>&lt;p&gt;About the speed - the queue is based on generic operators, all &amp;quot;smart things&amp;quot; are performed on compile time so, carefully speaking, the queue shouldn't be much slower than the first, straightforward implementation.&lt;/p&gt;
</description></item><item><title>The Weekly Source Code 4</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#4773055</link><pubDate>Thu, 06 Sep 2007 02:05:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4773055</guid><dc:creator>Scott Hanselman's Computer Zen</dc:creator><description /></item><item><title>F#</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#6232846</link><pubDate>Thu, 15 Nov 2007 02:57:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6232846</guid><dc:creator>LukeH's WebLog</dc:creator><description>&lt;p&gt;A few weeks back, Soma blogged about an increased investment by the Microsoft Developer Division in the&lt;/p&gt;
</description></item><item><title>F#, brought to you by Luke!</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#6262962</link><pubDate>Thu, 15 Nov 2007 17:34:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6262962</guid><dc:creator>Don Syme's WebLog on F# and Other Research Projects</dc:creator><description>&lt;p&gt;Luke Hoban is now full time as program manager on F#, and has just posted a short introduction about&lt;/p&gt;</description></item><item><title>F#, brought to you by Luke</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#6262969</link><pubDate>Thu, 15 Nov 2007 17:35:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6262969</guid><dc:creator>Don Syme's WebLog on F# and Other Research Projects</dc:creator><description>&lt;p&gt;Luke Hoban is now full time as program manager on F#, and has just posted a short introduction about&lt;/p&gt;</description></item><item><title>F#, brought to you by Luke</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#6263911</link><pubDate>Thu, 15 Nov 2007 18:06:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6263911</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;Luke Hoban is now full time as program manager on F#, and has just posted a short introduction about&lt;/p&gt;</description></item><item><title>Example of querying collections in C# 2.0 and 3.0 with LINQ</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#7372584</link><pubDate>Fri, 01 Feb 2008 13:55:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7372584</guid><dc:creator>dave^2=-1</dc:creator><description>&lt;p&gt;LukeH has a good example of how simple and expressive LINQ queries can be compared to more traditional&lt;/p&gt;
</description></item><item><title>re: In-Memory Query with C#2.0 and C#3.0</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#8605694</link><pubDate>Mon, 16 Jun 2008 18:09:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8605694</guid><dc:creator>Justin.Th</dc:creator><description>&lt;p&gt;Hi Luke,&lt;/p&gt;
&lt;p&gt;I think there is a slight bug in the C# 2.0 implementation in that you are relying on the ordering of the Dictionary.Keys collection to be the same as what was inserted. This may work in practice, but according to the docs:&lt;/p&gt;
&lt;p&gt;The order of the keys in the Dictionary&amp;lt;(Of &amp;lt;(TKey, TValue&amp;gt;)&amp;gt;).KeyCollection is unspecified&lt;/p&gt;
&lt;p&gt;Perhaps you should use a SortedDictionary and ditch the sort on the list of MethodInfos?&lt;/p&gt;
&lt;p&gt;I suppose it just goes to further demonstrate the beauty of C# 3.0: the code is terser, the objective of the code is more obvious and it is easier to get right!&lt;/p&gt;</description></item><item><title>Propecia sexual side effe.</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#8829586</link><pubDate>Mon, 04 Aug 2008 12:32:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8829586</guid><dc:creator>Propecia and online drugs stores.</dc:creator><description>&lt;p&gt;Propecia. Cheap propecia. Propecia online uk.&lt;/p&gt;
</description></item><item><title>re: In-Memory Query with C#2.0 and C#3.0</title><link>http://blogs.msdn.com/lukeh/archive/2007/03/31/in-memory-query-with-c-2-0-and-c-3-0.aspx#8945982</link><pubDate>Fri, 12 Sep 2008 10:10:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8945982</guid><dc:creator>graffic</dc:creator><description>&lt;p&gt;The second implementation is much slower. But let's explain why.&lt;/p&gt;
&lt;p&gt;LINQ was made to embed SQL into the code. Therefore it was supposed to use all the database &amp;quot;good things&amp;quot; to do the job.&lt;/p&gt;
&lt;p&gt;For me the only database good things are &amp;quot;indexes&amp;quot;. The way to access one record in a million in less than 0.1 seconds. Therefore when LINQ is translated in a SQL query of an indexed database we obtain:&lt;/p&gt;
&lt;p&gt;1. good performance&lt;/p&gt;
&lt;p&gt;2. good readability.&lt;/p&gt;
&lt;p&gt;But some times we need to handle in memory data. In that case we thing &amp;quot;hey! let's use linq again&amp;quot; But think now &amp;quot;who is gonna support your efforts when making queries?&amp;quot;. The answer is nobody.&lt;/p&gt;
&lt;p&gt;There is no special software for LINQ to objects. Then what linq does is to &amp;quot;sweep&amp;quot; the data structure collecting members that match your query.&lt;/p&gt;
&lt;p&gt;Of course this is slow as hell if you compare it with a dictionary.&lt;/p&gt;
&lt;p&gt;If you're gonna do it once. Is ok to wait because we will suffer it only once. But if the query is in a loop. You're delete the code after the second run because is just too much time.&lt;/p&gt;</description></item></channel></rss>