游戏开发

本类阅读TOP10

·DirectX 9.0 SDK 开发包下载(April 2005)
·完成端口的深入理解及一种变态用法
·初学者的福音:游戏开发新手入门指南
·linux下编写OpenGL程序的一些准备工作
·《学VC、编游戏》重点算法解疑·快一点
·Windows的消息机制与消息重定向技术
·《魔兽世界》的寻路体系和作弊原理分析
·《学VC、编游戏》重点算法解疑·再快一点
·5月新开传奇私服|6月新开传奇私服|传奇私服|新区
·《学VC、编游戏》重点算法解疑·狩猎谋生

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
Coding Tips(J2ME)

作者:未知 来源:月光软件站 加入时间:2005-5-13 月光软件站

Coding Tips
The following tips are only suggestions and may or may not give gains in performance, it
is to your own judgment and discretion to use them or not.
1. Use StringBuffer instead of String because of the fact the String object can not
be changed. Any modification to a String variable is actually a new object
creation.
2. Accessing class variables directly is faster then using setter and getter
methods
3. Using local variables are more efficient then instance/class variables
4. Using variables are more efficient then arrays.
5. Avoid synchronization in loops because there is an extra over head to lock and
unlock each time the loop occurs
6. Counting down in loops is faster then counting up
7. Use compound operators like x += 1 instead o f x = x + 1 because fewer byte
codes is generated
8. Remove constant calculations in loops
9. Reuse objects
10. Assign null to unused objects, especially unused threads
11. Try to use already built in methods, for example if you want to copy data from
one array to another use System.arraycopy more then likely this method will
be more efficient then the one you created yourself


相关文章

相关软件




月光软件程序下载编程文档电脑教程网站设计网址导航网络文学游戏天地幽默笑话生活休闲写作范文安妮宝贝
电脑技术编程开发网络专区谈天说地情感世界游戏元素分类游戏热门游戏体育运动手机专区业余爱好影视沙龙
音乐天地数码广场教育园地科学大观古今纵横谈股论金人文艺术医学保健动漫图酷二手专区地方风情各行各业

月光软件站·版权所有