Exploring LinQ

LinQ is very powerfull, really really powerfull.

Referring to my last post (LinQ: Max() vs OrderBy()-FirstOrDefault()) here is a similar example:

var i = (from item in listOfItems
where item.Size = listOfItems.Max(i => i.Size)
select item);

What about performance ?
What about that “listOfItems.Max(i => i.Size)” ?
Will be executed every iteration, or cached before cycle ?
Reflector may help you exploring the code LinQ is compiled in.

Dustin Campbell had same idea, with this post. 😉

source: Using Reflector to Explore LINQ



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: