hxcpp profiler

145 views
Skip to first unread message

Michael Baczynski

unread,
Mar 26, 2013, 5:22:05 AM3/26/13
to haxe...@googlegroups.com
Hi,

when trying to profile my game by calling cpp.vm.Profiler.start('log.txt') I get the message:
"Profiler terminated due to lack of activity Forced profile stop." after two or three seconds, but there's a lot going on.
Calling Profiler.start() repeatedly in an ENTER_FRAME call doesn't make sense to me. Any ideas?

best,
Michael

Hugh

unread,
Mar 27, 2013, 1:05:57 AM3/27/13
to haxe...@googlegroups.com
Hi,
The profiler loop is supposed to be kept alive by this code in Debug.cpp:

(hx::gSampleClock+100 < hx::gProfileClock)

Where gSampleClock is the last time a sample was taken, and the 100 is in units of approximately milli-seconds.

So maybe some processes is not sampling or taking longer than 100 ms between samples?

You could safely increase this number to 1000 or even 10000.  It is just so it does not drain your battery if you leave it running on say android.

Maybe you are not sampling at all, try recompiling with:

-D HXCPP_STACK_TRACE

Hugh

Michael Baczynski

unread,
Mar 27, 2013, 8:31:33 PM3/27/13
to haxe...@googlegroups.com
Hi Hugh,

thanks. I'm compiling with HXCPP_STACK_TRACE. When I start the profiler in my Main.main() function, I get some output from the profiler but then it shuts down.
When I play with the numbers (increase to 1000 or 10000) I don't get any output at all. The main loop of my game takes approx. 1-2ms.
BTW, I'm using haxe+hxcpp from svn and latest nme from git.

best,
Michael
Reply all
Reply to author
Forward
0 new messages