开发者

Why LINQ 2 sql gives better perfomance?

开发者 https://www.devze.com 2022-12-28 04:54 出处:网络
I read in some article that LINQ to SQL gives better开发者_运维问答 performance when executing stored procedure than Entity framework. Any obvious reasons for it?There could be a performance differenc

I read in some article that LINQ to SQL gives better开发者_运维问答 performance when executing stored procedure than Entity framework. Any obvious reasons for it?


There could be a performance difference, in L2S you can make your sproc return a list of l2s objects which are going to be tracked for changes. For large result sets this could be a severe performance hit, if you're not going to change these objects.

I don't know how Entity Framework handles these kind of situations.

In L2S you can also turn this behaviour off in your datacontext. (ObjectTrackingEnabled = false)

0

精彩评论

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