uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

Profile drawing calls made by dotsTheDrawablesManager #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As of October2011, dotsTheDrawablesManager.mayDrawNextFrame() maintains a list 
of frame timing information for frames that were not back-to-back with the 
previous frame.  This applies to the first frame in a block of animation, and 
frames that were late (i.e. frame skips).

It would be useful to also profile drawing commands to find specific 
performance problems.  Based on the documentation for Matlab's profile() 
function, it looks like we should be able to resume and stop the profiler 
during mayDrawNextFrame().  This would allow focused profiling of drawing 
commands.

The profiling behavior should be optional, since profiling affects performance.

dotsTheDrawablesManager could have three new functions and two new properties 
for doing draw profiling.

startDrawProfiling() would initialize the Matlab profiler and set 
isDrawProfiling to true.

isDrawProfiling would be a flag to tell mayDrawNextFrame() whether resume and 
stop the Matlab profiler for drawing commands.

stopDrawProfiling() would stop the Matlab profiler and store the profiler 
"info" results in drawProfileInfo.

drawProfileInfo would store profiler "info" results from the most recent draw 
profiling.

viewDrawProfiling() would launch the Matlab profview() function with the stored 
results in drawProfileInfo.

Original issue reported on code.google.com by Benjamin.Heasly on 27 Oct 2011 at 6:35

GoogleCodeExporter commented 8 years ago
I'm doing this today.

Original comment by Benjamin.Heasly on 28 Oct 2011 at 2:06

GoogleCodeExporter commented 8 years ago
I implemented these behaviors in r681.  Since profiler info can be too large to 
fit in a mxGram, and therefore can't be sent through dotsTheMessenger, the 
behavior is only defined for the server-side.

That makes sense because only the server executes drawing commands.  However, 
it may be inconvenient if the server machine is physically hard to access.

I'm calling this done.

Original comment by Benjamin.Heasly on 28 Oct 2011 at 4:43