实体框架V4:" code只与QUOT;性能注意事项 [英] Entity Framework V4: "Code Only" performance considerations

查看:187
本文介绍了实体框架V4:" code只与QUOT;性能注意事项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要开始工作的一个新的项目,我想知道如果code只有是正确的道路要走。我们也在考虑通过设计其他模型第一种方法,但宁愿设计的EF设计之外我的领域模型。

I'm about to start working on a new project and am wondering if "Code Only" is the right way to go. We're also considering the other model-first approach through the designer, but would rather design my domain models outside of the EF designer.

我们的域名可能会包含100多个单位。我读过一个巨大的实体的数量会有所减慢EF(即:创建内容和第一次调用的SaveChanges)。

Our domain will likely contain 100+ entities. I've read that a huge number of entities can somewhat slow down EF (ie: Creating the context and first call to SaveChanges).

由于没有EDMX文件来存储元数据,是这种方法可能是慢?我在网上搜索,但一直没能找到有关这方面的消息。

Since there's no EDMX file to store the metadata, is this approach likely to be slower? I've searched the web but haven't been able to find any information on this.

我知道这仍然只是在CTP和缺失很多功能,但我只是在寻找输入/指导,在这一点上。

I know this is still only in CTP and missing lots of functionality, but I'm just looking for input/guidance at this point.

推荐答案

由于.NET 4中,其中包括EF4为Beta 1的当前,你不会得到任何有用的一般的答案。为了您的具体情况下,为什么不试。

As .NET 4, including EF4 is Beta 1 currently you are not going to get any useful general answer. For your specific case why not test.

创建一个实体的实体模型,并运行一些性能测试。然后展开模式有更多的实体,并重新运行测试。如果模型的实体数量的性能影响,你应该会看到一个性能上的差异。

Create an entity model with one entity and run some performance tests. Then expand the model to have more entities and re-run the test. If there is a performance impact of the number of entities in the model you should see a performance difference.

记住打折荷载效应,除非你只关心在启动应用程序,执行一个操作,然后关机。

Remember to discount load effects, unless you are only interested in applications that start up, perform a single operation and then shutdown.

这篇关于实体框架V4:" code只与QUOT;性能注意事项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆