开发者

Compiled LINQ queries - NHibernate

Looking at this link shows me that compiled queries can be used to improve performance in Linq to SQL apps (I've seen other examples in Entity framework):

http://blog.linqexchange.com/index.php/how-to-use-compiled-queries-in-linq-to-sql-for-high-demand-asp-net-websites/

This requires a parameter that inherits DataContext - which I don't think NHIbernate has, b开发者_如何学Pythonut is the point of this question.

I have looked at these links:

https://nhibernate.jira.com/browse/NH-2389

Compile NHibernate Linq expressions

but I don't see an up-to-date and definitive answer.

If anyone has the answers, I would love to hear them :)


Inspecting the current NHibernate trunk, shows that NHibernate caches query plans for LINQ queries, so it is not necessary to explicitly compile queries for reuse. The only extra overhead is the calculation of the unique cache key for the LINQ expression.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜