在不影响性能的pre-观编译 [英] pre-compiled view not affecting performance

查看:80
本文介绍了在不影响性能的pre-观编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:

这问题不是编译查询,它是关于发生在编译​​时EF数据库视图。

This question is not about compiled queries, it is about generating the EF database view at compile time.

从ADO.NET团队博客:<一href=\"http://blogs.msdn.com/b/adonet/archive/2008/02/04/exploring-the-performance-of-the-ado-net-entity-framework-part-1.aspx\"相对=nofollow>探索ADO.NET实体框架的性能 - 第1部分:

From the ADO.NET team blog: Exploring the Performance of the ADO.NET Entity Framework - Part 1:

查看生成56% - 创建数据库的抽象视图提供在店内的母语查询和更新实际视图的重要组成部分。在此步骤中,将创建店里的意见。好消息是,有使构建过程的视图生成一部分,所以这一步可以在运行时可避免的一种方式。

View Generation 56%– A big part of creating an abstracted view of the database is providing the actual view for queries and updates in the store’s native language. During this step, the store views are created. The good news is there is a way of making view generation part of the build process so that this step can be avoided at run time.

在我的web应用程序的第一个数据库调用大约需要2.5秒,而不是〜后续调用相同的30毫秒。


The first database call in my web app takes about 2.5 seconds instead of ~30 ms for subsequent identical calls.

使用我从<一的T4模板生成一个precompiled查看源文件href=\"http://blogs.msdn.com/b/adonet/archive/2008/06/20/how-to-use-a-t4-template-for-view-generation.aspx\"相对=nofollow> ADO.NET团队博客,但没有作出任何检测的差异。

I generated a precompiled view source file using the T4 template from the ADO.NET team blog, but it has made no detectable difference.

本T4模板大约需要2.5秒,运行和生成的code编译。

The T4 template takes about 2.5 seconds to run and the generated code compiles.

我是什么失踪?

推荐答案

固定它!

这EntityViewContainer衍生生成视图必须是包含特定贸易义务自跟踪的对象,而不是包含EDMX模型中的一个组件。

The Generated View derived from EntityViewContainer must be in the assembly that contains the STOs Self-Tracking Objects, not the one that contains the edmx model.

这篇关于在不影响性能的pre-观编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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