开发者

linq vs ado.net performance

I am going to work with Linq data access model. Which Model performance is better? and why t开发者_如何学运维o use and why not to use Linq.

Thanks


There is always a trade off between abstraction level and performance, so of course, Linq To Entities or Linq To Sql, which both work on top of ADO.NET, will be slower than ADO.NET.

It is all about what level of performance you need for your particular project. If performance is more crucial for you than ease of development then go with straight DataReaders. If not then go for Linq To Entities.


Linq to SQL and Entity Framework etc. all use ADO.NET internally, thus they are slower since they do more work than ADO.NET alone.

The idea is not to get the best performance but the best abstraction, model your domain with objects so you can reason about your data and the commands that operate on that data. So it's a good idea to trade some performance for other aspects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜