.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

        Cache Aggressively
        Use Session State Only If You Need To
        Use View State Only If You Need To
        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 Call809971805.600
Class Non-Virtual Call268478412.546
Class Virtual Call109117738.369
ValueType Virtual (Obj Method) Call3004286.205
ValueType Virtual (Overridden Obj Method) Call2917140.844
Load Type by Newing (Non-Static)1434.720
Load Type by Newing (Virtual Methods)1369.863

Morehttp://msdn.microsoft.com/library/en-us/dnpag/html/scalenet.asp?frame=true

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值