Burst is a compiler that works on a subset of C# referred to in the Unity context as High-Performance C# (HPC#). Burst uses LLVM to translate .NET Intermediate Language (IL) to code that’s optimized for performance on the target CPU architecture.
Burst was originally designed for use with Unity’s job system. Jobs are structs that implement the IJob interface and represent small units of work that can run in parallel to make best use of all available CPU cores. Designing or refactoring your project to split work into Burst-compiled jobs can significantly improve the performance of CPU-bound code. For more information, refer to Write multithreaded code with the job system.
Aside from jobs, Burst can also compile static methods, as long as the code inside them belongs to the supported subset of C#. For more information on what’s included in High-Performance C#, refer to HPC# overview.
Burst is central to Unity’s Entity Component System (ECS) technologies, which includes a series of interdependent packages that work together to produce high performance code. However, Burst can be used independently of ECS and can be integrated into any Unity project that uses supported C# features.
For more information on Burst, refer to the Burst compiler package documentation.
Burst is not a complete scripting back end because it only supports a subset of C#. It can’t replace MonoA scripting backend used in Unity. More info
See in Glossary or IL2CPPA Unity-developed scripting back-end which you can use as an alternative to Mono when building projects for some platforms. More info
See in Glossary in your project but is supplemental to either of them.
When you include the Burst package in your project, the scripting back end compiles the code by default and Burst compiles whichever Burst-compatible parts of it are marked for Burst compilation.
Your C# scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary compile to Intermediate Language (IL) as usual. For methods marked for Burst, that IL is further compiled by Burst into native code. Burst compiles just-in-time (JIT) in the Unity Editor’s Play mode but ahead-of-time (AOT) in Player builds.
The subset of C# supported by Burst doesn’t support managed objects. Unity has packages designed to provide Burst-compatible versions of common types and data structures. The Collections package offers Burst-compatible collections such as arrays and lists, and Unity Mathematics offers Burst-compatible mathematics functions.
Code is Burst compiled if the following conditions are met:
[BurstCompile] attribute or is referenced from code that is.You can use the scripting symbol ENABLE_BURST_AOT to conditionally compile sections of your code only when the Burst AOT compilationAhead of Time (AOT) compilation is an optimization method used by all platforms except iOS for optimizing the size of the built player. . More info
See in Glossary setting is enabled.
For more information, refer to Burst compilation