关于新EF5自动编译查询功能查询功能、于新

2023-09-03 16:25:33 作者:都是矿泉水装什么纯中纯

我做了关于新EF5自动编译查询设有一些测试。问题是,我没有看到任何性能上的差异。

I've made few tests regarding the new EF5 auto-compiled queries feature. The problem is that I don't see any difference in the performance.

我不使用编译查询做了一个项目,.NET 4.0和EF4.0。 我做了另外一个项目,.NET 4.0和EF4.0编译查询 - 有性能提高50%。

I've made one project with .NET 4.0 and EF4.0 without using compiled queries. I've made another project with .NET 4.0 and EF4.0 with compiled queries - there was 50% improvement in performance.

然后我试图创建与EF 5.0的一个项目,其中有基本性能没有区别。

And then I tried to create a project with EF 5.0, in which there was basically no difference in performance.

所有的项目都是asp.net的MVC(前两次分别是第3版,最后一节 - 第4版)。

All the projects were asp.net mvc (first two were version 3, the last one - version 4).

我失去了一些东西呢?有没有我需要做的,启用自动编译功能,一些特别的东西?我刚刚创建MVC 4项目,pre-构建EF5内。

Am I missing something here ? Is there something special I need to do to enable the auto-compile feature ? I just created MVC 4 project with pre-build EF5 inside.

我用来测试的查询是相当冗长,三联接和内多个过滤器。

The query I am testing with is rather verbose, three joins and multiple filters inside.

感谢您

推荐答案

自动编译查询是在EF5部分居住在.NET Framework 4.5提供。如果您在.NET Framework 4的查询运行EF5不会被自动编译。

Auto compiled queries are available in the part of EF5 live in the .NET Framework 4.5. If you are running EF5 on .NET Framework 4 queries are not automatically compiled.