Mvc RenderAction 性能与 RenderPartial [英] Mvc RenderAction performance vs RenderPartial
问题描述
我想知道 mvc C# 的渲染操作是否与在我的评论中直接调用部分一样有效,如果不是,它的效率有多低.
Hi I was wondering if mvc C#s render action was as efficient as calling the partial in my review directly, and if not, how inefficient it was.
推荐答案
RenderAction
肯定会比 RenderPartial
慢.差异将取决于您的子操作相对于父操作执行了多少额外的工作.对于非常简单的子动作,差异应该很小(慢了几个百分点).在不知道您的特定应用程序的情况下,很难判断.如果您担心性能,您应该进行一些测量.
RenderAction
will certainly be slower than RenderPartial
. The difference will depend on how much additional work your child action is performing relative to the parent action. For a very simple child action the difference should be pretty small (few % points slower). Without knowing your particular application it's hard to tell. If you are worried about performance you should do some measurements.
这篇关于Mvc RenderAction 性能与 RenderPartial的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!