当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 优化VB.NET应用程序的性能1

ASP.NET
Asp.net Ajax--Calendar控件使用
让ASP.NET程序自动为URL加上超级链接
ASP.NET2.0MasterPage技巧总结
asp.net读取数据库乱码的解决完全方案
asp.net中生成缩略图并添加版权
ASP.Net用MD5和SHA1加密的几种方法
asp.net客户端回调功能的实现机制
ASP.NET2.0中控件的简单异步回调
用在JavaScript的RequestHelper
用Java发送图文并茂的HTML邮件
基于.NET平台的分层架构实战(一) 综述
基于.NET平台的分层架构实战(二)需求分析与数据库设计
基于.NET平台的分层架构实战(三)架构概要设计
基于.NET平台的分层架构实战(四)实体类的设计与实现
近期的几个ASP.NET开发经验总结和收集
ASP.NET中的状态管理
asp.net基础知识介绍
对数据访问层第一种实现(Acc+SQL)的重构
.NET初学者推荐课程 asp.net错误代码大全
在.net中如何利用数据工厂实现多数据库的操作

ASP.NET 中的 优化VB.NET应用程序的性能1


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 69 ::
收藏到网摘: n/a

(1) 整数除法运算符 \ 和 / \ 比 / 快10倍 (如果是整数除法并且不需要保留小数) (2) 赋值运算符 a +=b 和 a = a+b += 快 (3) 串联运算符 & 和 + 用 & 快 (来源:http://www.devcity.net/newsletter/archive/devcity/devcity20040315.htm#ni030) .NET Pro: Optimize the Performance of VB.NET Applications
Operators
by Mike McIntyre
Division: \ V.S. /
Divide integral values with the \ (back slash) operator when you do not need decimal points or fractional values. The \ operator is the integral division operator and it is up to 10 times faster than the / (forward slash) operator.
Compound Assignment Operators: a += b V.S a = a + b
Compound assignment statements first perform an operation on an argument before assigning it to another argument. Example:
a += b
In the example above, b is added to the value of a, and that new value is then assigned to a. Compound assignment operators are more concise than their constituent operators (separate + and =). Compare the statement above to the one below. The statement above is a shorthand equivalent of the statement below.

a = a + b
Compound assignment operators are faster. If you are operating on an expression instead of a single variable, for example an array element, you can achieve a significant improvement with compound assignment operators.
Compound assignment operators for numbers: ^= *= /= \= += -=
Compound operator for strings: &= Example:Dim a As String = "First " a &= "Name"
Result: First Name
Concatenation: & V.S. +
Use the & concatenation operator instead of the + operator to increase the speed of concatenations. Performance of the & and + operators are only equivalent if both operands are type String. If not, the + operator is late bound and must perform type checking and conversions.