Game Development Reference
In-Depth Information
When you run your game with the Profiler window open, the graph will populate
with statistics about the most recent frames. The profiler doesn't usually record
information about all the frames since the game began, but only the most recent
ones as will fit into memory sensibly. There is a toggleable "deep proile" method
available in the upper toolbar of the Profiler window, which allows you (in theory)
to get extra information about your game, but I'd recommend that you avoid this
mode. It can cause performance issues with the Unity Editor when running asset-
heavy and code-heavy games, and it can even freeze the editor altogether. Instead,
I'd recommend that you only use the default mode. When using this mode, in most
cases, you'll want to disable the visualization of VSync from the CPU Usage area to
get a better view of other performance statistics, including Rendering and Scripts , as
shown in the following screenshot. To do this, simply click on the VSync icon in the
graph index area:
Disabling the VSync display from the CPU usage area in the Profiler window
The horizontal axis of the graph represents frames—the most recent frames added
to the memory buffer. This axis keeps populating with new data while the game is
running. The vertical axis represents time or computational expense: higher values are
expressive of a more demanding and slower frame time. After the graph is filled with
some data during the Play mode, you can pause the game to examine its state. Select
the frames from the graph to view more information on game performance during that
frame. When you do this, the Hierarchy panel in the bottom half of the Profile window
fills with function data about the code that is being executed on the selected frame.
When viewing the graph, it's good practice to watch for sudden increases (peaks or
spikes), as shown in the following screenshot. These indicate frames of sudden and
intense activity. Sometimes, they can be one-off occurrences that are either unavoidable
due to hardware operations or that happen legitimately and are not the source of
performance problems, such as scene transitions or loading screens.
 
Search WWH ::




Custom Search