VR4Medical/ICI/Library/PackageCache/com.unity.burst@6aff1dd08a0c/Documentation~/index.md
2025-07-29 13:45:50 +03:00

4.5 KiB

Burst compiler

Compile compatible sections of your C# code into highly-optimized native CPU code.

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.

Aside from jobs, Burst can also compile static methods, as long as the code inside them belongs to the supported subset of C#. Mark code for Burst compilation by applying the [BurstCompile] attribute to jobs or to static methods and their parent type.

Topic Description
Get started Get started with Burst by creating your first simple Burst-compiled example code.
C# language support Check which elements of the C# language belong to the high-performance subset of C# that Burst can compile.
Burst compilation Understand how Burst compiles code in different contexts, mark your code for Burst compilation, and configure aspects of the compilation process.
Burst intrinsics Use low-level intrinsics to get extra performance from Burst if you're writing single instruction, multiple data (SIMD) assembly code.
Editor reference Use the Burst menu and Burst Inspector window in the Unity Editor to configure Burst options and inspect the Burst-compilable jobs in your project.
Building your project Build your project with the appropriate toolchains and Burst Ahead-of-Time (AOT) compilation settings for your target platform and architecture.
Optimization Debug and profile to identify bugs or bottlenecks in Burst-compiled code and configure a range of options to optimize performance.
Modding support Include Burst-compiled code as additional libraries in your mods.

Installation

To install the Burst package, follow the instructions in the Add and remove UPM packages or feature sets documentation.

If you change the Burst package version (for example, via Update), you need to close and restart the Editor.

Additional resources

Videos

Conference presentations given by the Burst team:

Blogs

Blog posts written by members of the Burst team :