Open Source Platform
for interconnected virtual worlds

NaaliProfiler

From Rex community wiki

Naali Code Execution Profiler

The new Naali viewer has a built-in code profiler and other statistics tools to help the individual module developers measure the performance of their code.

To use the profiler, compile Naali with the PROFILING preprocessor macro enabled. This macro is present in the root CMakeLists.txt and in trunk it is enabled by default, but this might change in the future.

It is important to understand that the profiler is a system-wide feature and not controllable on a per-module basis. That is, the whole architecture must be built either with or without the PROFILING flag enabled.

File:Prof1.png

If Naali is built with PROFILING enabled, the profiler window can be accessed from the console using the "Prof" command.

File:Prof2.png

The basic feature of the profiler is the ability to measure code execution times. See the PROFILE() macro in Profiler.h on how to add fine-grained coverage to your own code.

File:Prof3.png

Code execution blocks can be viewed either in tree view mode or in a list mode. The tree is built according to the code call hierarchy. In list mode, the entries are sorted descending by per-call average time consumption, in a similar fashion than what the utility 'top' offers.

File:Prof4.png

The per-frame execution time view allows detecting unwanted processing spikes and jittery performance behavior. Each vertical line shows the time consumed in processing a single application frame. This view is useful for detecting and optimizing worst case per-frame performance.

File:Prof5.png

The Ogre tab shows information about the internal memory pools in Ogre. This is a useful tool for detecting memory consumption issues in graphics-related code.

File:Prof6.png

The Network tab measures in- and outbound network performance. It can be used to detect network loss and bursted transfer conditions.

File:Prof7.png

OpenSim periodically sends a network message that contains statistics about the server-side performance. This information is shown in the SimStats tab.