Skip to main content

Posts

Showing posts from 2010

LINQ : Query expression vs Lambda Expression

All the time I was using LINQ on projects I was wondering whether there is a performance difference between query expression and lambda expression. So I decided to dig into it. I wanted to examine MSIL for both of these situations. I wrote small class which has two methods. One is using query expression and the other one is using lambda. I complied this code and got the dll and view the MSIL using ildasm.exe. This following picture will show you the MSIL of GetFirst() method. And this following picture will show you the MSIL of the GetSecond() method. Yes!!! you can see that there is no different between these 2 MSIL. Will there be a performance difference???