设置调试=假实际上造成慢得多渲染? [英] Setting debug=false actually causing far SLOWER rendering?

查看:84
本文介绍了设置调试=假实际上造成慢得多渲染?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题;通常,当您设置调试=假在web.config文件和编译在Release模式Web应用程序,可提高性能。对于我的网站上某些网页,它的 majorly 的减慢渲染。下面是在调试模式下页面:

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:

没有,我没有得到这两个困惑。地球上什么可能会造成调试模式下进行渲染页面快3倍(如果你忽视了控制器和SQL的性能,它呈现在网页快五倍)?有什么明显的,我可以配置错误?

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?

推荐答案

简短的回答:这个问题是 Microsoft.AspNet.Web.Optimization Beta2的;它是做什么的非常的效率低下,会加入第二个到你的网页渲染时间。如果你使用它,升级。现在。

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.

我把史蒂芬的建议和使用MiniProfiler,看是什么原因导致在视图中放缓。这是jQuery UI的JS的 System.Web.Optimization.Scripts.Render()渲染:

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:

根据的意见,这个问题(也< A HREF =htt​​p://stackoverflow.com/questions/11000093/mvc4-rc-script-bundling-very-slow>这个问题似乎解决这一问题),我升级:

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'.

这两个升级 Microsoft.AspNet.Web.Optimization WebGrease 。下面是我升级之后,在同一页:

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

嗯。 :-)我只是敲了99.9%关闭页面的渲染时间。我的网站上的其他网页渲染快很多了。我不知道是什么 Microsoft.AspNet.Web.Optimization Beta2的在做,但它像一个球和链条围绕ASP.NET!

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!

这篇关于设置调试=假实际上造成慢得多渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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