Profiler
Displaying 1-7 of 7 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Jesse

Hey guys,

I have a suggestion for a verge profiler. It's like 15 lines of code, which I've already written and been using on my own. Basically, it adds a "profile" key to verge.cfg, which if present and non-zero, causes verge to dump a list like this when it closes:

Time Profile:
func1_name: 34 calls, 12 total time
func2_name: 10 calls, 0 total time
....


The timing is a bit coarse right now, but that could be improved. A windows timing function called getClock() (could just use C clock()) needs to be added to win_system or something.

This requires modifying the startup code to check for the profile key, modifying the core to store timing/calls in maps and dump the result, and modifying err() to call the dump function before exit. Thoughts?

EDIT: I've made the timing microsecond-sensitive, at least on Macs. This should also be easy in Windows. I'm also timing libfuncs as well.

Posted on 2005-12-16 22:43:14 (last edited on 2005-12-16 23:22:38)

Kildorf

This is actually really cool, Jesse!

Identifying hotspots in the code will make everyone more productive and awesome. This way we won't be stuck guessing or fixing the 95% of the program that uses 5% of the CPU time.

Also, I wanted to post here so that others could see it. I don't think anyone noticed it because of that language-translation thread.

Posted on 2005-12-18 07:45:58

adderd

There is no need for a 'verge' profiler. There are external programs that do a better job than any of us are bound to do.

In my linux port (for those of you that don't know, I piggybacked off of Jesse's work and created a linux port) I used the builtin GCC profiling stuff to profile verge. In most RPG's the vast majority of time is spent drawing things (ddXX_TBlitT, ddXX_TBlitT_lucent, etc). And so those functions are good candidates for optimization. Also, some have mentioned that vergec might not be as optimized as it could be. I have yet to test that myself.

I'm not sure what the state of profiling support is in Windows.

Posted on 2006-02-06 11:18:04

CrazyAznGamer

Windows = very little profiling. You basically rely on the code, and in some cases, the Task Manager, which will only tell you how much memory the program is using at any given time.

This profiler would be very useful for the majority of the people out there, besides. Just a thought.

Posted on 2006-02-06 16:39:22

adderd

Quote:
Originally posted by CrazyAznGamer

Windows = very little profiling. You basically rely on the code, and in some cases, the Task Manager, which will only tell you how much memory the program is using at any given time.

This profiler would be very useful for the majority of the people out there, besides. Just a thought.



Well, you CAN use GCC in windows. Maybe most people dont want to but it's possible. You can even use CygWin or MinGW to compile windows programs that take advantage of DirectX.

A search on the internet reveals that MSVC++ does support a profiling flag. Do the profiling utilities suck or something?

Have you tried gprof in linux? It's pretty thorough!

Posted on 2006-02-06 19:52:25

CrazyAznGamer

The majority of us don't have huge DirectX SDKs and MSVC++ (Ok, the majority of us do have that, but I don't).
So, I'm talking about the script itself. You know, help out the common man.
Besides, the profiling utilities aren't...
well...
Let's just say Jesse's way is probably better for MS users.

Posted on 2006-02-07 21:46:28

adderd

Yeah, I see your point. An in-vergec profiler that can profile vergec code would be a nice addition.

Posted on 2006-02-07 22:06:59


Displaying 1-7 of 7 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.