Reputation: 1
Is Entity Framework faster than ado.net for Queries?
My test shows that ado.net is faster than Entity Framework in querying.Why?
Upvotes: 0
Views: 1169
Reputation: 34248
ADO.Net is used by EF under the scenes. This means that overall EF is always going to be slower than ADO.Net (assuming they both are generating similar SQL statements)
However I have observed an interesting performance characteristic with EF5 vs ADO.Net and a low number of rows (either queried or inserted). EF5 appears to be consistently faster than ADO.net for under 10 items. I imagine this is due to an optimisation at connection setup time however I haven't yet tracked down what this is.
My results around this and a little more explanation is avaliable here
If anyone has any more information around why EF5 appears so fast on small datasets I would love to hear.
NOTE in this post I actually don't show the raw ADO.net results but they are very similar to the dapper results. I actually wanted to answer this specific question before posting the ADO.Net results :)
Upvotes: 1