Use [`SkipLocalsInitAttribute`](xref:Unity.Burst.CompilerServices.SkipLocalsInitAttribute) to tell Burst that any stack allocations within a method don't have to be initialized to zero.
In C# all local variables are initialized to zero by default, which prevents a class of bugs related to undefined data. But this can impact runtime performance because initializing this data to zero takes work:
In this example, the `movabs rax, offset burst.memset.inline.X64_SSE4.i32@@32` line means that you've had to inject a memset to zero out the data. In the above example, you know that the array is entirely initialized in the following loop, but Burst doesn't know that.
To fix this problem, use [`Unity.Burst.CompilerServices.SkipLocalsInitAttribute`](xref:Unity.Burst.CompilerServices.SkipLocalsInitAttribute), which tells Burst that any stack allocations within a method don't have to be initialized to zero.
>[!NOTE]
>Only use this attribute if you're certain that you won't run into undefined behavior bugs.
For example:
```c#
using Unity.Burst.CompilerServices;
static unsafe int DoSomethingWithLUT(int* data);
[SkipLocalsInit]
static unsafe int DoSomething(int size)
{
int* data = stackalloc int[size];
// Initialize every field of data to be an incrementing set of values.
for (int i = 0; i <size;i++)
{
data[i] = i;
}
// Use the data elsewhere.
return DoSomethingWithLUT(data);
}
```
The assembly after adding the `[SkipLocalsInit]` on the method is: