保存在DBContext上的性能测试 [英] Performance Test for Save on DBContext
问题描述
请参阅配置文件测试的附图,以便使用实体框架将具有三个子实体的实体保存一千次。 ID列被称为200万次[< g class =" gr_ gr_294 gr-alert gr_spell gr_run_anim ContextualSpelling"
data-gr-id =" 294" ID = QUOT; 294">它的< / g取代;在基类中定义]并且其余属性正在获得50K +调用。这使得< g class =" gr_ gr_464 gr-alert gr_gramm gr_run_anim Grammar only-ins replaceWithoutSep"数据-GR-ID =" 464"
id =" 464"> system< / g>慢。 我正在使用Generics来创建存储库(存储库模式)。我想知道这些电话的确切原因。 [对不起图像中的插图]。
Please refer to attached image of profile test for saving an entity with three child entities one thousand times using entity framework. The ID column is getting called 2 million times[ <g class="gr_ gr_294 gr-alert gr_spell gr_run_anim ContextualSpelling" data-gr-id="294" id="294">its</g> defined in base class] and rest properties are getting 50K+ calls. This is making <g class="gr_ gr_464 gr-alert gr_gramm gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="464" id="464">system</g> slow. I am using Generics to create repositories (repository pattern). I want to know the exact cause of these calls. [Sorry for the cuttings in the image].
问候,
AKS
推荐答案
您好aks_1610,
Hi aks_1610,
请提供有关执行测试的相关代码。
Please provide a related code about the perform Test.
此外,关于EF性能,您还可以参考以下文档。
In addition, about EF performance, you could also refer the following documents.
https://msdn.microsoft.com/en-us/library/hh949853(v = vs.113)的.aspx
祝你好运,
Cole Wu
这篇关于保存在DBContext上的性能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!