.NET 应用程序的性能提升应用技巧
最近花了很多时间研究.net性能提升问题,在ms的网站上也找到很多不错的资料,下面这些内容估计大家或多或少的用过一些,在这里贴出来,希望能对大家的工作有所帮助。
performance tips for all applications:
throw fewer exceptions
make chunky calls
design with valuetypes
use addrange to add groups
trim your working set
use for loops for string iteration―version 1
use stringbuilder for complex string manipulation
precompile windows forms applications
use jagged arrays―version 1
keep io buffer size between 4kb and 8kb
be on the lookout for asynchronous io opportunities
performance tips for asp.net applications[来源 www.iocblog.net]
cache aggressively
use session state only if you need to
use view state only if you need to[来源 www.iocblog.net]
avoid sta com
batch compile
remove unnecessary http modules
avoid the autoeventwireup feature
encode using ascii when you don't need utf
use the optimal authentication procedure
appendix: cost of virtual calls and allocations
call type # calls/sec
valuetype non-virtual call 809971805.600
class non-virtual call 268478412.546
class virtual call 109117738.369
valuetype virtual (obj method) call 3004286.205
valuetype virtual (overridden obj method) call 2917140.844
load type by newing (non-static) 1434.720
load type by newing (virtual methods) 1369.863
more:http://msdn.microsoft.com/library/en-us/dnpag/html/scalenet.asp?frame=true
出处:有气质的熊(minbear) blog
文章整理:iocblog
版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。