Optimization is the process of taking an application and making it more efficient. For graphical applications, this typically means modifying the application to make it faster.
For example, a game with a low frame rate means it appears jumpy. This gives a
bad impression and can make a game difficult to play. You can use optimization to
improve the frame rate of a game making it a better, smoother experience.
To optimize your code, use the optimization process. This is an iterative
process that guides you through finding and removing performance problems.
The optimization process consists of the following steps:
- Take measurements of your application with a profiler.
- Analyze the data to locate the bottleneck.
- Determine the relevant optimization to apply.
- Verify that the optimization works.
- If the performance is not acceptable return to step 1 and repeat the
The following is an example of the optimization process:
- If you have a game that does not have the performance you require, you can
use the Unity profiler to take measurements.
- Use the Unity profiler to analyze the measurements so you can isolate and identify
the source of the performance problem.
- The problem with the game is, for example, rendering too many vertices.
- Reduce the number of vertices in your code.
- Execute the game again to ensure the optimization worked.
If you do this and the game still does not perform as expected, restart the
process by profiling the application again to find out what else is causing
Expect to repeat this process a number of times. Optimization is an iterative
process where you might find performance problems in a number of different areas.