Program to time your app?
Does anyone know of a good (freeware pref.) program to find out in which functions your app spends the most time?
Edit: Forgot to mention that I need one for Win2k |
Well, if you are prepared to use Dev-C++, you can use gprof which comes with it. I have never used gprof before, but seeing your post I just recompiled world.exe with Dev-C++ with profiling enabled ( -pg option to compiler and linker). Here is the sort of output it gives you:
http://www.rama.demon.co.uk/worldprof.txt |
gprof is also in gcc if you use linux, it along with kprof (a KDE visual front end) , and valgrind, kcachegrind, and leaktracer have been some of my favorite tools recently.
Under MS compilers, I really dont know much other than the commerical ones. Numega tools are AWESOME.. |
Finally got my app working under dev-cpp, but the profiling doesn't seem to work.
First I tried it manually by adding a -pg to the c++ compiler options like the manual says. But then the linker yelled at me that it can't find "mcount" (unresolved external). A quick search revealed that both "libgmon.a" and "libuser32.a" contain a "mcount". libuser doesn't work though, but after linking to libgmon the game compiles fine. Only problem is: There's no output! :( The menu entry "profile analysis" does ... well ... something, but after running there's no .txt either. What am I doing wrong? |
You need to put -pg in the linker parameters as well, i.e. Under project/project options/parameters, specify -pg in both the C++ compiler and the linker boxes. I just tested and omitting it from the linker options does give you the unresolved references to mcount.
|
Quote:
|
Quote:
Quote:
So I'll stick to gprof for now :) |
WinXP has a feature that shows which program you use the most...mine says:
EverQuest Photoshop Ad-Aware Dreamweaver MX Flash MX (for some odd reason) Notepad Microsoft Word now are you talking about which programs you use the longest or what? |
Nah, a program that tells me which parts of my own programs consume the most time.
|
Its a performance profiler for code...
Have 3 functions, A , B and C. It will tell you when the program executes it spent 5% of its time executing A, 90% B, and 5% C. Helps you to find code bottlenecks.. |
Yay, it works!
Well, more or less, gprof itself says that the output is invalid, but dev-c++ has no problems with it, which is good enough for me (for now at least). 75% of the time spent in the same function ... doh! |
Quote:
When I tested it, I CDed to the directory where my exe and gmon.out where, and then did c:\dev-cpp\bin\gprof <myprog>.exe and it worked fine. |
hmmmm, you have to run gprof on the .exe? Never tried that.
"gprof gmon.out" gives me the "not in a.out format" message. Will try it again tonight with the exe. |
gprof will automaticlly grab the gmon file, you have to specify the binary.. I made the same mistake initially, I assumed it just needed to read the output file...
|
All times are GMT -4. The time now is 11:40 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.