Microsoft LINQ Books

Programming Microsoft LINQ & Introducing Microsoft LINQ
Welcome to Microsoft LINQ Books Sign in | Join | Help
in Search

Marco Russo

LINQ query optimizations

Look at this excellent blog post written by K. Scott Allen. I completely agree with him: don't try to optimize a LINQ query until you measure its performance and understand it is really a bottleneck that needs to be improved.

An interesting consideration I never made before is that you can call the OrderBy extension method after the Select and not before. Yes, using the query syntax of C# you are used to put the Select after the OrderBy, but sometime it could be better to invert this order (the reasons are already well explained in the Scott Allen's post).

And, of course, consider that performance have to be evaluated in two dimension: time and space. And, sooner than later, a third dimension (parallelism) will gain the same importance.

Published sabato 19 luglio 2008 7.28 by Marco.Russo

Comments

 

Marco Russo said:

Recentemente ho scritto alcuni post in inglese nel mio blog su LINQ: Campi varchar(1) usando LINQ to

luglio 20, 2008 10.25
Anonymous comments are disabled
Powered by Community Server (Personal Edition), by Telligent Systems