开发者

Linq and sqlclient performance

I want to create a web application using ASP.NET. Which method should I use, LINQ or SQL query? Which gives the best开发者_如何学Go performance? Please help me.


This is an excellent series by a CLR Performance Architect describing LINQ to SQL performance: http://blogs.msdn.com/b/ricom/archive/2007/06/22/dlinq-linq-to-sql-performance-part-1.aspx


Performance-wise I think you'll always be better off with SQL. If you take a look at the generated SQL code which LINQ produces you'll notice that it's not always that top notch.

On the other hand, LINQ isn't slow. It's not as fast as SQL, but it's definitely not slow. If you think about the advantages LINQ provides I would always prefer LINQ over SQL if I have the choice.

If performance is the BIG issue tho, sticking with SQL might be your best shot. If you were just wondering if the difference was that major, and if you don't expect database-performance to be a bottleneck I'd go for LINQ.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜