Have you ever wonder why your scene is running so slow? What’s the culprit of the performance degradation? In Maya 2015 extension, we provide a new profiler tool for you to track down performance bottlenecks in your scene by recording the amount of time that each process consumes.
We also provide programming interfaces to access this feature. Specifically, in MEL/Python, you can use command “profiler” to start and stop the recording of events, add profiling categories and instrument procedures for profiling.
Furthermore, two new classes, MProfiler and MProfilingScope, have been added that allow you to work with Maya's Profiler. MProfiler is a static class which provides access to profiler settings and the profiling result. MProfilingScope is used to profile code execution time. Profiling begins with the creation of an MProfilingScope instance and ends when the instance is destroyed (e.g. when it goes out of scope at the end of the block in which it was declared). For example, if you want to profile any code snippet, you can instrument it like this:
{
MProfilingScope profilingScope(testCategory, MProfiler::kColorD_L1, "eventName", "eventDescription");
// The code snippet you want to profile.
}
For more information, you can check out the MProfiler and MProfilingScope class documentation in Maya help online.
I image this would be very beneficial to TDs and sometimes plug-in developers. As this will give you a better idea of which part of evaluation is the bottleneck and help debug problems in your evaluation of Dependency Graph. So happy debugging!
Comments