504 VI Debugging and Proﬁling
35.2 Scope and Requirements
The ﬁnal goal is to give developers and artists a general look at the time consump-
tion for the different threads of the application, be it on the CPUs or on the GPU.
The tool can be used to search for bottlenecks and synchronization problems in the
targeted application. We aim at fulﬁlling the following requirements:
• Accuracy. We want our measurements to be as accurate as possible. We
also want to minimize the perturbations due to our measurements and debug
• Real time. Coupled with a live update system of in-game assets, this system
enables artists to tune the quality of their models, textures, and sound settings
in order to ﬁt in the imposed time constraints. Having a real-time proﬁler also
enables us to analyze how the application’s performance is impacted during its
• Ease of use. User-friendliness is an important element, as it makes the tool
accessible not only to developers but also to artists. We also want the tool to be
easy to use on the developer side because making it easy to place markers in the
code will result in more markers being inserted and better granularity in the
measurements. Finally, we want the data to be displayed in a useful manner,
making it easy to spot synchronization problems and performance bottlenecks
and identify whether we are CPU-bound or GPU-bound.
• Portability. The proposed tool is embedded inside the game engine itself,
and the display is done using the same renderer the game is based on. As
a consequence, the time querying functions a re the only platform-dependent
part. Having a portable proﬁling tool gives a uniform and coherent feeling
across all supported platforms, thus making proﬁling easy when switching to
a new, unknown platform. While it doesn’t replace a ﬁne platform-speciﬁc
external debugger like gDEBugger [Graphic Remedy 10, AMD 11], at the
time of switching to a new platform, all previously developed functionality is
immediately available and no learning curve is needed.
• Small. We want the proﬁler to be enabled and displayed throughout the
whole development process so that developers can keep track of the evolution
of time consumption and detect performance problems as soon as possible.
This can only be done if the space taken on the screen is minimal.