Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Code optimization

Project configuration, design patterns, and coding strategies to help optimize the performance of your code.
Read time 1 minuteLast updated 5 days ago

Considering performance in all the code you write helps your project scale without bottlenecks. There are several ways you can improve performance, including avoiding bad practices, profiling your code, implementing appropriate design patterns, and using techniques like asynchronous programming to split work across multiple threads of execution.

Topic

Description

Unity programming best practicesKey issues to be aware of when writing code for Unity applications, along with best practices to help you avoid common pitfalls.
Asynchronous programmingAsynchronous programming in Unity with the .NET
async
and
await
keywords and Unity's own custom
Awaitable
class.
Job systemUse Unity's own
Job
system to get the most out of multi-core CPUs and parallelize your algorithms.
Optimizing your code for managed memoryApproaches for optimizing your code to work with managed memory.
Using unmanaged API for transform operationsUse the
TransformHandle
API as an alternative to the
Transform
API.

Additional resources