教你50招提升ASP.NET性能(十一):避免在调试模式下运行网站

时间:2022-05-22 18:34:37

(17)Avoid running sites in debug mode

招数17:

避免在调试模式下运行网站

When it comes to ASP.NET, one of the most common performance blunders I see on a regular basis is accidentally or intentionally running sites in debug mode. Language-level optimizations, such as using StringBuilders, Arrays instead of Lists, Switch instead of If-Then-Else, and so on, are popular, but when you measure their real impact, they usually pale in comparison to optimizations at the framework level.
当涉及到ASP.NET,我经常看见的最常见的性能错误是偶然或故意在调试模式运行网站。语言级的优化,如使用StringBuilders,Arrays替换List,Switch替换If-Then-Else,等等,很受欢迎,但是当你权衡它们的实际的影响时候,与框架级别的优化相比往往是很苍白的。