DEV Community

Discussion on: C# and .NET Core Appreciation Post. The most beautiful piece of code I have ever seen... this month!

sduduzog profile image
Beautus S Gumede Author

I just read through the stackoverflow link and I'm stunned. But through that revelation, I had to wonder how performant a Lambda api would fare up against 100 million rows of data as opposed to using a raw query

vekzdran profile image
Vedran Mandić • Edited on

Hey. Your thoughts stream to right questions! Actually EF is a lot slower than raw cons (or Dapper queries), for a test in the following link 10x to 15x times, but the test is not a real world scenario, i.e. do not infere that Dapper or ADO is better, as speed is just one treat. Read more about the test:

Also EF has to cache your lambdas after translating them for the first time into SQL strings. Also note some queries can not be cached due to their dynamic construction (you can build up a query with multiple C# statements) such as any query using a .Where(x => someNumbers.Contains(x.Id)), as the SQL “where in” (it is actually a ton of OR statements if you look into SQL) part is actually calculated each time.

Using EF is certainly not a question of speed.