In order to optimize the code, people need to know where the code uses most CPU time.
gprof can be used to find that out. Steps to use it
1. add option -pg to CFLAGS, CXXFLAGS and LINK in make file
2. make clean and recompile your code
3. run your code(for example guiapp) and you will get a file gmon.out
4. type command "gprof guiapp | less" to see the info
From the steps above you can find which function uses the most CPU time. Then you may either find some errors there or try to optimize this function. Good luck
[ 此贴被steinlee在2008-08-25 11:29重新编辑 ]