Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MProfiler/trace performance tracing when using Pixar's batch renderer #260

Conversation

mattyjams
Copy link
Contributor

This takes a cue from recent work in the VP2.0 render delegate and adds some performance tracking to Pixar's batch renderer Hydra integration. This is proving to be helpful as we work to deprecate our usage of the legacy viewport, and also as we look towards eventually adopting the VP2.0 render delegate.

The MProfilerScopes added are good for tracking overall time spent in the batch renderer when using Maya's Profiler. The trace performance tracking is good for looking at the time spent in batch renderer setup and overhead versus the time spent in underlying Hydra and USD libraries, since those are also instrumented using trace.

The one change here that affects users not using the batch renderer is the addition of a TRACE_FUNCTION() call in MayaUsdProxyShapeBase::boundingBox(). A lot of time is currently spent generating bounding boxes (serially) using the batch renderer, so that may also be a current bottleneck for the VP2.0 render delegate.

This category will be used to track viewport performance when using Pixar's
"batch renderer" Hydra integration.
lib/nodes/proxyShapeBase.cpp Show resolved Hide resolved
MProfilingScope profilingScope(
ProfilerCategory,
MProfiler::kColorG_L3,
"Batch Renderer Adding Shape Adapter");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are in the batch renderer category, what's the advantage of adding Batch Renderer to every event name? It makes names very long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was finding the full event name useful when looking at the CPU or thread views in the Profiler vs. the category view. That way I could see batch renderer performance in the context of a full scene render and not have to turn off any other categories.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some additional tricks related to profiler and category view. Explore the option to collapse events. This reduces the noise by collapsing all events to starting one on a thread. What will remain is a view of the current concurrency level.

You can find this option in the right-click menu, acting on selected events.

…nderer

The MProfilerScopes added are helpful for tracking overall time spent in the
batch renderer when using Maya's Profiler. The trace performance tracking is
good for looking at the time spent in batch renderer setup and overhead versus
the time spent in underlying Hydra and USD libraries, since those are also
instrumented using trace.
…ProxyShapeBase

It turns out that a significant amount of time is spent generating bounding
boxes when using Pixar's batch renderer. Adding the trace in the proxy shape's
boundingBox() function ensures that that time is captured when looking at
performance data.
@mattyjams mattyjams force-pushed the pr/add_pixar_batch_renderer_performance_tracing branch from 1a4f030 to 40ec8d6 Compare February 7, 2020 20:42
@kxl-adsk kxl-adsk merged commit 840881c into Autodesk:dev Feb 10, 2020
@mattyjams mattyjams deleted the pr/add_pixar_batch_renderer_performance_tracing branch February 10, 2020 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants