07 2013 档案

摘要:(30)Static collections招数30:静态集合If a collection is static, make sure it only contains the objects you need. If the collection is iterated over often, then the performance can be slow if you don’t remove unnecessary objects. Objects in a collection will be held in memory, even if they have been dispos 阅读全文
posted @ 2013-07-31 13:52 安布雷拉 阅读(311) 评论(0) 推荐(0)
摘要:(29)Before tackling any website performance issue, first verify the problem isn’t on the client招数29:在处理网站性能问题前,首先验证问题是否出在客户端Traditionally, many performance problems have been rooted in either the database or application server. 习惯上,许多性能问题要么根植于数据库或者应用服务器。However, with the proliferation of advanced Ja 阅读全文
posted @ 2013-07-29 14:16 安布雷拉 阅读(256) 评论(0) 推荐(0)
摘要:(28)Don’t assume that problems can only arise from business logic招数28:不要认为问题只会从业务层产生When beginning to diagnose performance problems, we often assume the problem is in our business logic. Don’t forget that the areas of our code that provide infrastructure can cause problems as well.当开始诊断性能问题时,我们一般认为问 阅读全文
posted @ 2013-07-26 14:29 安布雷拉 阅读(287) 评论(0) 推荐(0)
摘要:(27)Throw hardware at the problem, not developers招数27:把问题仍给硬件而不是开发人员As developers, we often want to fix problems with code, but don’t be afraid to ‘put the compiler down’ and throw some hardware at the problem.作为开发人员,我们通常想通过代码解决问题,但不要害怕‘批评编译器’和把问题仍给硬件。Performance problems caused by disk I/O bottlene 阅读全文
posted @ 2013-07-25 14:30 安布雷拉 阅读(307) 评论(0) 推荐(0)
摘要:(26)Don’t underestimate the value of the UI when tackling performance problems招数26:解决性能问题时不要低估UI的价值Simple UI tricks, such as progress bars, redirecting users’ attention using animation, or placing slower loading sections at the bottom of a page or offscreen, can often ‘fix’ a performance problem wit 阅读全文
posted @ 2013-07-24 14:17 安布雷拉 阅读(332) 评论(0) 推荐(0)
摘要:(25)Use the startMode attribute to reduce the load time for your ASP.NET site招数25:使用startMode属性来减少ASP.NET站点加载时间Every time you update your site, IIS must recompile it during the first request, so the initial request takes significantly longer than subsequent ones. An easy solution is to tell IIS to a 阅读全文
posted @ 2013-07-22 14:07 安布雷拉 阅读(452) 评论(0) 推荐(0)
摘要:(19)A selection of tips招数19:精选技巧集合Including height and width in tags will allow your page to render more quickly, because space can be allocated for the image before it is downloaded.在标签中包括height和width属性会加速你的页面呈现,因为下载完成之前空间可以分配给图像。(20)Add script references at the bottom of the page, because asynchr. 阅读全文
posted @ 2013-07-19 16:24 安布雷拉 阅读(245) 评论(0) 推荐(0)
摘要:(18)When in production, carefully consider what you need to log招数18:在生产环境,仔细考虑你需要记录哪些日志Many people deploy to production without checking how logging is currently configured. It is always advisable to check whether your policy is to have logging on or off by default and, if on, what level you should 阅读全文
posted @ 2013-07-18 14:14 安布雷拉 阅读(342) 评论(0) 推荐(0)
摘要:(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, Swit 阅读全文
posted @ 2013-07-17 14:07 安布雷拉 阅读(291) 评论(0) 推荐(0)
摘要:(16)Reduce the data sent across the network招数16:减少通过网络发送的数据Reducing the amount of data sent across the network can improve application performance significantly. Compressing CSS and JavaScript is possible using bundling and minification. This will reduce the number of server requests and the amount 阅读全文
posted @ 2013-07-16 14:20 安布雷拉 阅读(201) 评论(0) 推荐(0)
摘要:(15)Reduce memory leaks dramatically with the “using” statement招数15:显式的使用using语句减少内存泄露If a type implements IDisposable, wrap the use of it in a “using” statement, so that it automatically disposes of objects properly when the block exits.如果一个类实现了IDisposable接口,使用using语句包裹这个类型,以便离开语句块就能自动的释放恰当的对象。 阅读全文
posted @ 2013-07-15 13:31 安布雷拉 阅读(321) 评论(0) 推荐(0)
摘要:(14)Review what client scripts you are using招数14:检查你使用了什么客户端脚本Out of the box, many ASP.NET projects include client script libraries which you may or may not beusing. It’s always a good idea to check what you are using, and when.拿来即用,很多ASP.NET项目包括你可能会或可能不会用的客户端脚本库。检查你正在使用什么,并在需要时候使用它总是一个好的方法。 阅读全文
posted @ 2013-07-11 14:13 安布雷拉 阅读(185) 评论(0) 推荐(0)
摘要:(13)Always perform validation on the server as well招数13:总是在服务器端执行验证This isn’t exactly a performance tip but rather a security tip for when people think that they could improve performance by cutting out server-side validation. These days, client-side validation can be bypassed with ease, so you can’ 阅读全文
posted @ 2013-07-10 13:25 安布雷拉 阅读(270) 评论(0) 推荐(0)
摘要:(12)For a snappy user experience, always validate on the client招数12:为了生动的用户体验,总是在客户端验证To avoid unnecessary round trips to the server, validate form entries on the client using JavaScript before posting them. This provides quick feedback and makes your application feel more responsive. Always make su 阅读全文
posted @ 2013-07-09 14:08 安布雷拉 阅读(254) 评论(0) 推荐(0)
摘要:(11)Make sure paging is conducted at the database layer招数11:确保分页是在数据层完成的When using grid UI controls (framework based, or 3rd party owned), you should carefully consider how paging is implemented. Many controls implement paging in a simplistic fashion, where the database is required to return all ava 阅读全文
posted @ 2013-07-08 14:13 安布雷拉 阅读(244) 评论(0) 推荐(0)
摘要:(4)A selection of tips招数4:精选的技巧Make sure HTTP compression is turned on for any uncompressed content. HTML in particular compresses significantly, and in this era of mobile friendliness and slow 3G connections, that’s essential.确保为未压缩的内容打开HTTP压缩。在这个面向移动友好和3G连接缓慢的时代,HTML压缩尤其明显,这是至关重要的。(5)Always set th 阅读全文
posted @ 2013-07-05 15:05 安布雷拉 阅读(227) 评论(0) 推荐(0)
摘要:(3)Use Microsoft’s PDBs to debug or profile external assemblies or libraries招数3:使用Microsoft的PDBs调试和分析外部的程序集和库To accurately debug or profile an external assembly or library (i.e. one you’re not directly compiling), you need the PDB files that accompany each of the DLLs.These files give your debugger 阅读全文
posted @ 2013-07-04 14:27 安布雷拉 阅读(265) 评论(0) 推荐(0)
摘要:(2)Remove unused View Engines招数2:移除不用的视图引擎If you're an ASP.NET MVC developer, you might not know that ASP.NET still loads the View Engines for both Razor and Web Forms by default. This can cause performance issues because MVC will normally look for Web Forms views first, before switching over to 阅读全文
posted @ 2013-07-03 14:06 安布雷拉 阅读(405) 评论(0) 推荐(0)
摘要:(1)Caching is a last resort招数1:缓存是最后的手段Projects that use multiple levels of cache often demonstrate a misunderstanding of why caching is required in the first place.项目中使用多重缓存经常会表现会产生误会,为什么缓存是第一步必须的。Caching is not synonymous with performance. Your code should already be efficient. Caching should only 阅读全文
posted @ 2013-07-03 14:05 安布雷拉 阅读(503) 评论(0) 推荐(0)