我们正在为我们的ASP.NET应用程序使用ADO.NET实体。ADO.NET实体框架 - 预生成视图 -
我读过预先生成的视图提高了性能。提到博客文章,
http://blogs.msdn.com/adonet/archive/2008/06/20/how-to-use-a-t4-template-for-view-generation.aspx,我生成的意见。所产生的命名空间&类作为
namespace Edm_EntityMappingGeneratedViews
{
/// <Summary>
/// The type contains views for EntitySets and AssociationSets that were generated at design time.
/// </Summary>
public sealed class ViewsForBaseEntitySets4D4A6E0AA7AF6B2298FABB4F22235831 : System.Data.Mapping.EntityViewContainer
{
/// <Summary>
/// The constructor stores the views for the extents and also the hash values generated based on the metadata and mapping closure and views
/// </Summary>
public ViewsForBaseEntitySets4D4A6E0AA7AF6B2298FABB4F22235831()
{
this.EdmEntityContainerName = "JSEntities";
我将此添加到我的数据层和测试性能。看不到太多的改进。 CPU使用率始终达到20-30%的利用率(响应时机良好),并在500毫秒 - 1秒内降低回0%。我认为每次都会因为视图生成而使CPU利用率变高。
尽管MyModel.edmx & MyModel.Views.cs与文件名匹配,但我无法理解实体框架如何知道这是我的模型事件的预生成视图类。
我是否需要更新Web.Config或App.Config以将View类映射到某个位置?
请说明。
检查哪个进程正在使用CPU。你的SQL Server在同一台机器上吗? – 2009-07-19 21:14:26