This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / C/C++中,为了提高程序的运行速度:1. 用一元操作符:++,--, -=, +=, *=, /=
2. 用移位: <<, >>
3. 用点汇编程序
4. 在循环嵌套的情况下, 把循环次数多的放里面。
还有什么其它的办法吗? 请跟贴。
-tonyhao(tonyhao);
2007-10-4
{158}
(#3971314@0)
-
Dont not instance and destroy class variable frequently. C io functions are more efficient. Pass pointer instead of passing reference...
-foolzz(foolzz);
2007-10-4
(#3971723@0)
-
"Pass pointer instead of passing reference" ? Are you sure?
-kaia(清渣工);
2007-10-4
(#3971874@0)
-
maybe pass reference (or pointer) instead of value if sizeof(data) > sizeof(pointer)
-wangqingshui(忘情水);
2007-10-4
(#3971960@0)
-
改进算法。
-informix(informix);
2007-10-4
(#3971746@0)
-
right
-jiashang(加上);
2007-10-4
(#3971758@0)
-
这里的东西应该能有些帮助:
-walacato(一天到晚游泳的鱼);
2007-10-4
(#3972251@0)
-
换台快点的机器
-peeler(逛街的西瓜);
2007-10-4
(#3972298@0)
-
inline functions; use ++i instead of i++; use initialization list (in constructor)... Most importantly, know your bottle neck before any performance tuning.
-dusk(~小桥流水~);
2007-10-4
(#3972338@0)
-
Regarding to performance improvement, try NOT to use virtual functions even if polymorphism is one of the most important portions in C++.
-kaia(清渣工);
2007-10-4
(#3972998@0)