This is a follow-up to my two previous posts on the let keyword

The real reason for this post is to link to a great post that K.Scott Allen has just published : Optimizing LINQ Queries. In his post, he shows an example where using the let keyword decreases performance. More importantly, he makes the point that you shouldn’t prematurely optimise your queries and that you need to measure the performance. Although I was taking measurements in Part 2, I don’t think I did a good enough job of making this point in the post. So to make up for that: the let keyword is a tool in your toolbox. Make sure you measure the performance before you decide you need to optimise your queries, and make sure you measure them after any performance ‘improvements’ to verify the results. And if you haven’t read the Optimizing LINQ Queries post, do it now to find out why let didn’t improve performance...