Performance Tuning Strategies.

Think about efficiency from each of these viewpoint
1. Program requirements. Performance is stated as a requirement far more often than is actually is a requirement. Before you invest time solving a performance problem, make sure that you're solveing a problem that needs to be solved.
2. Program design. If you know that a program's size and speed are important, design the program's architecutre so that you can reasonably meet your size and speed goals. Design a performance-oriented architechture, and then set resource goals for individual subsystems, features and classes.
3. Class and routine design. One key to performance that comes into play at this level is the choice of data types and algorithms, which usually affect both the memory use and the execution speed of a program.
4. Operation-system interactions. If your program works with external files, dynamic memory or output device, it's probably interacting with the operation ystem.
5. Hardware. Sometimes the cheapest and best way to improve a program's performance is to buy new hardware.
6. Code tuning. Code tuning is the practice of modifying correct code in ways that meke it run more efficiently.

Steps to code tuning:
1. Develop the sofeware using well-designed code that's easy to understand and modify.
2. If performance is poor
 a. Save a working version of the code so that you can get back the the "last known good  state".
 b. Measure the system to find hot spots.
 c. Determine whether the weak performance comes from inadequate design, data types, or  algorithms and whether code tuning is appropriate. If it isn't appropriate, go back to step  1.
 d. Tune the bottleneck identified in step(c).
 e. Measure each improvement one at a time.
 f. If an improvement doesn't improve the code, revert to the code saved in step(a).
3. Repeat from step 2.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值