Use the settings in the Burst menu to control how Burst works in the Unity Editor. These settings control Burst compilation in the Editor only. To configure Burst compilation for Player builds, refer to Burst AOT Settings reference.
To access the Burst menu, go to Jobs > Burst. The following settings are available:
| Setting | Function |
|---|---|
| Enable Compilation | Enable this setting to activate Burst compilation. When you enable this setting, Burst compiles jobs and Burst custom delegates that you tag with the attribute [BurstCompile]. |
| Enable Safety Checks | Choose what safety checks Burst should use. For more information, refer to Enable Safety Checks setting. |
| Off | Disable safety checks across all Burst jobs and function-pointers. Only use this setting if you want more realistic profiling results from in-Editor captures. When you reload the Editor, this setting always resets to On. |
| On | Enable safety checks on code that uses collection containers (e.g NativeArray<T>). Checks include job data dependency and container indexes out of bounds. This is the default setting. |
| Force On | Force safety checks on even for jobs and function-pointers that have DisableSafetyChecks = true. Use this setting to rule out any problems that safety checks might have caught. |
| Synchronous Compilation | Enable this setting to compile Burst synchronously. For more information, refer to Synchronous compilation. |
| Native Debug Mode Compilation | Enable this setting to deactivate optimizations on all code that Burst compiles. This makes it easier to debug via a native debugger. For more information, refer to Native Debugging tools. |
| Show Timings | Enable this setting to log the time it takes to JIT compile a job in the Editor and display it in the Console. For more information, refer to Show Timings setting. |
| Open InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info See in Glossary |
Opens the Burst Inspector window. |
To disable Burst’s safety check code, use DisableSafetyChecks. This results in faster code generation, but you must ensure that you use containers in a safe fashion.
To disable safety checks on a job or function-pointer set DisableSafetyChecks to true:
[BurstCompile(DisableSafetyChecks = true)]
public struct MyJob : IJob
{
// ...
}
If you set Enable Safety Checks to On in the Editor, then Burst ignores code marked explicitly with DisableSafetyChecks = true when it safety checks your code. Select Force On to make Burst safety check all code, including code marked with DisableSafetyChecks = true.
When you enable the Show Timings setting, Unity logs an output in the Console windowA Unity Editor window that shows errors, warnings and other messages generated by Unity, or your own scripts. More info
See in Glossary for each library of entry points that Burst compiles. Burst batches the compilation into units of methods-per-assembly, and groups multiple entry-points together in a single compilation task. This output is useful if you want to report outliers in compilation to the Burst compiler team via Unity Discussions.
Unity splits Burst’s output into the following major sections:
The compile time in the front end and optimizer is linear to the number of operations that Burst needs to compile. More functions and more instructions means a longer compile time. The more generic functions you have, the higher the front end performance timings, because generic resolutions have non-zero costs.
The compile time in the back end scales with the number of entry-points in the module. This is because each entry point is in its own native object file.
If the optimizer takes a significant amount of time, use [BurstCompile(OptimizeFor = OptimizeFor.FastCompilation)] which reduces optimizations but compiles much faster. Profile the job before and after to make sure that this tradeoff is right for that entry-point.