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.