Identifying performance bottlenecks with the Unity performance Profiler
Optimization principal 4: Use performance data to drive design and coding decisions.
As well as following general asset and code design principals, which we know ought to lead to improved performance, we should be aware that each game is different and that, in reality, the only way to know which design decisions affect performance the most is to collect and analyze runtime performance data. While a raw Frames Per Second (FPS) measurement is useful, to choose between different decisions having detailed information about the processing requirements for rendering and code execution for each frame is invaluable.
The Unity 5 Profiler offers a detailed breakdown of code and rendering processing requirements, as well as processing required by GPU, audio, and both 2D and 3D physics. Perhaps the most useful, it allows programmers to explicitly record data for named code segments. We will name our profile MATT_SomeCalculations...