设置debug = false实际上导致远的SLOWER渲染? [英] Setting debug=false actually causing far SLOWER rendering?

查看:90
本文介绍了设置debug = false实际上导致远的SLOWER渲染?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题;通常在您的web.config文件中设置 debug = false 并在发布模式下编译Web应用程序时,会提高性能。对于我网站上的某些页面,主要是减慢渲染速度。这是调试模式下的页面:





...这是与发布模式相同的页面,调试模式已关闭:





否我没有让那两个人混淆。地球上可能会导致调试模式更快地渲染页面(如果您忽略控制器和SQL性能,则会使页面的FIVE时间更快)?有没有什么明显的错误配置?

解决方案

简短的答案:问题是 Microsoft.AspNet。 Web.Optimization beta2;它正在做某些极端效率低下,并会在您的页面呈现时间上添加一秒。如果您正在使用它,请升级。现在,






我采取了史蒂文的建议,并使用MiniProfiler查看导致视图放缓的原因。这是jQuery UI JS的 System.Web.Optimization.Scripts.Render()渲染:



< img src =https://i.stack.imgur.com/0lqjD.pngalt =渲染之前的时间>



根据这个问题(另外,这个问题似乎解决了这个问题),我升级了:

  PM>更新包Microsoft.AspNet.Web.Optimization 
在项目'Bacp.Assess.Web'中将1.0.0-beta2版本更新为Microsoft.AspNet.Web.Optimization至1.0.0。

这将升级 Microsoft.AspNet.Web.Optimization WebGrease 。升级后,这是同一页:





Uhm。 :-)我刚刚敲下了99.9%的页面渲染时间。我网站上的其他页面也快得多。我不知道什么 Microsoft.AspNet.Web.Optimization beta2正在做,但它就像一个围绕ASP.NET的球和链!


I've got a strange problem; normally when you set debug=false in your web.config file and compile your web application in Release mode, it increases performance. For some pages on my site, it's majorly slowing down the rendering. Here's the page in debug mode:

... and here's that same page in Release mode with debug mode turned OFF:

No, I didn't get those two confused. What on Earth could be causing debug mode to be rendering the page 3 times quicker (if you ignore the controller and SQL performance, it renders the page FIVE times quicker)?! Is there anything obvious I could have misconfigured?

解决方案

Short answer: the problem was Microsoft.AspNet.Web.Optimization beta2; it is doing something extremely inefficient and will add a second onto your page rendering time. If you're using it, upgrade. Now.


I took Steven's advice and used MiniProfiler to see what was causing the slowdown in the view. It was the System.Web.Optimization.Scripts.Render() rendering of the jQuery UI JS:

As per the advice of this question (also, this question seems to address the issue), I upgraded:

PM> Update-Package Microsoft.AspNet.Web.Optimization
Updating 'Microsoft.AspNet.Web.Optimization' from version '1.0.0-beta2' to '1.0.0' in project 'Bacp.Assess.Web'.

This upgrades both Microsoft.AspNet.Web.Optimization and WebGrease. Here's the same page after I upgraded:

Uhm. :-) I just knocked 99.9% off the rendering time of the page. Other pages on my site are rendering a lot quicker too. I don't know what Microsoft.AspNet.Web.Optimization beta2 was doing but it's like a ball and chain around ASP.NET!

这篇关于设置debug = false实际上导致远的SLOWER渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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