Burst vs. IL2CPP: Generics

Generics, be they variables, methods, or functions, are language features that trigger IL2CPP surprises. Can Burst do better? Let’s find out!

Read the rest of this article »

5 Comments

Dangers of Arrays in Burst

Tags: , ,

Normally Burst-compiled jobs can’t use managed arrays, but there’s an exception for static readonly fields. This comes with several dangers, which we’ll explore today.

Read the rest of this article »

No Comments

How IL2CPP Calls Burst

Tags: , ,

Ever wonder how code compiled with IL2CPP can call code compiled by Burst? Today we’ll dive into the details and find out!

Read the rest of this article »

No Comments

Job-Safe APIs in Unity 2019.1

Tags: , ,

With each new release of Unity, more and more job-safe APIs are added. Today we’ll look at the new ones and learn how we can move even more code into high-performance C# jobs.

Read the rest of this article »

2 Comments

Throwing Exceptions in Burst-Compiled Jobs

Tags: , ,

Unity’s Burst compiler imposes an interesting subset of C#. The “no managed objects” rule of thumb is not always correct. Today we’ll look at eExceptions, which are managed objects but are partially supported by Burst. What’s allowed and what’s banned? Read on to find out.

Read the rest of this article »

1 Comment

Burst’s FloatPrecision and FloatMode: Don’t Assume

Tags: , ,

Unity 2019.1’s new Burst job compiler has two options to increase performance even further: FloatPrecision and FloatMode. By sacrificing some exactness in our calculations, we should be able to increase speed. Today’s article is about using those options and examining the results to verify the results.

Read the rest of this article »

6 Comments

Use the Right Type for the CPU

Tags: , , ,

The Unity.Mathematics package documentation has a curious statement: “Note that currently, for an optimal usage of this library, it is recommended to use SIMD 4 wide types (float4, int4, bool4…)” Today we’ll explore why we should consider using float4, not float3, after years of using Vector3.

Read the rest of this article »

5 Comments

Free Performance with Unity.Mathematics

Tags: , , , , ,

Along with Unity 2019.1 and Burst, the Unity.Mathematics package is now out of Preview. It offers alternatives to longstanding core types in Unity such as Vector3, Matrix4x4, and Quaternion. Today we’ll see how switching to these types can improve performance in Burst-compiled jobs.

Read the rest of this article »

4 Comments

Free Performance with Burst

Tags: , , ,

Unity 2019.1 was released last week and the Burst compiler is now out of Preview. It promises superior performance by generating more optimal code than with IL2CPP. Let’s try it out and see if the performance lives up to the hype!

Read the rest of this article »

12 Comments

Awkward Objects

Tags: , ,

We create objects out of structs and classes all the time, but oftentimes these evolve to the point where using them is really awkward. Today we’ll learn to recognize the telltale signs of an overextended object design and how to easily fix it.

Read the rest of this article »

1 Comment