I recently spent a lot of time researching. net Performance Improvement issues, on the MS website also found a lot of good information, the following content is estimated to be more or less used, posted here, I hope it will be helpful to everyone's work.
Performance tips for all applications:
- Throw fewer exceptions
- Make chunky cballs
- 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 jarged 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
Use view State only if you need
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 calland allocations
| Call type |
# CILS/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