Windows应用程序的优化 [英] Optimiztion of Windows Application

查看:105
本文介绍了Windows应用程序的优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问我有一些技巧可以优化Windows应用程序的速度

May I get some tips to optimize the speed of Windows application
any good advises will be appreciated.

推荐答案

第一步是找到性能不佳的地方.然后向我们展示您需要优化的代码段,然后也许有人会找到解决方案.
The first step would be to find the points of bad performance. Then show us the piece of code where you need to optimize, and then, maybe someone here will find a solution.


避免循环中的数据库连接
避免不必要的转换
avoid data base connections in loops
avoid unnecessary conversions


你好

1,性能上最令人头疼的事情是处理异常,因此,如果创建自己的ApplicationExeptions,请尝试避免抛出异常而不是事后处理它们,但是请不要删除try ...
捕获块,它们只有在处理真正的异常时才会降低性能.

2.使用显式类型转换编写代码(不要让CLR代替您执行类型转换),因为这也会显着降低性能

3.当您处理相当复杂的计算时,可以尝试使用C ++代码插入

4.尝试避免在另一个交换机{}中使用交换机{}

5.不要使用System.Drawing功能(因为它们基于旧引擎)
Hello

1.The thing that is a big headache of performance is handling exceptions.So, if you create your own ApplicationExeptions, try to avoid throwing them rather that handle them afterwards.However, do not remove try ...
catch blocks, they can reduce performance ONLY when they handle real exception.

2.Write code with explicit type conversions(do not let CLR do type conversions instead of you), because it also reduces performance significantly

3.You can try using insertions of C++ code, when you are handling rather complicated calculations

4.Try avoid using Switch{} within another switch{}

5.Do not use System.Drawing features(cause they are based on old engine)


这篇关于Windows应用程序的优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆