Skip to content

Add optional tracy profiler

This MR supports real-time profiling of VTK applications in release builds with the ability to view source code. All of this is possible thanks to Tracy. For now, it annotates core VTK methods into zones for the performance profiler.

Features:

  1. Due to the nanosecond resolution of Tracy along with detailed information about context switching, developers can quickly determine performance hotspots in VTK C++.
  2. OpenGL GPU events are also collected using query objects by Tracy. This lets developers visually identify graphics API hotspots.
  3. As all VTK data array memory allocation goes through vtkBuffer::Allocate, Tracy can build a live memory map that tells developers where chunks of memory were allocated and freed(if ever).
  4. Individual frames are scaled down in resolution and transmitted to the profiler. This helps visually associate an image in the timeline of a VTK application.

Screenshots:

  1. This screenshot shows a real-time profile session in Tracy's server for a VTK unit test ./bin/vtkRenderingCoreCxxTests TestCompositePolyDataMapper -I. Included is a memory map of VTK allocations and performance profiles for annotated methods.

image

  1. Here's a different screencast that displays images rendered by the unit test in the timeline as unique frames. It is similar to Chrome/Firefox dev tools. This is possible thanks to vtkOpenGLAsyncFrameRecorder(introduced by this MR) which captures and lazily emits frames without blocking the main application. Maybe ParaView can use this class to speed up "Save Animation"

sample-profile-session-windows

The VTK unit test must be run as a root user for context-switching information to show up. Knowing when the CPU runs your code and when it does not is really useful!

Edited by Jaswant Panchumarti (Kitware)

Merge request reports