Posts Tagged job

How SharedStatic Works

Tags: , , , ,

Burst 1.2 comes with a new feature: SharedStatic<T>. This allows us to write to static variables from within Burst-compiled code like jobs and function pointers. Today we’ll look at how this is implemented by Burst and IL2CPP. We’ll also put them to a performance test to see how fast they are.

Read the rest of this article »

4 Comments

Burst Function Pointers vs. Jobs

Tags: , , ,

Function pointers aren’t the only way to express a unit of work. Unity’s own job system does just this, albeit in a different way. Today we’ll compare the performance of Burst’s function pointers against jobs themselves!

Read the rest of this article »

3 Comments

Burst Function Pointers vs. Switch Statements

Tags: , , ,

A couple weeks ago we took a look at the performance of function pointers in Burst. In doing so, we left out an alternative: good old switch statements. Today we’ll put those to the test to see how they stack up next to Burst’s newfangled function pointers!

Read the rest of this article »

3 Comments

Burst Function Pointers Performance

Tags: , , ,

Last week we took a look at function pointers in Burst 1.2 and Unity 2019.3. Today we’ll continue looking into them by analyzing their performance.

Read the rest of this article »

4 Comments

Function Pointers in Burst

Tags: , ,

Unity 2019.3 and Burst 1.2 bring us support for function pointers! Behind the scenes, these power everyday C# functionality like virtual and abstract functions, delegates, and interfaces. Today we’ll look at how to use them and what Burst compiles them to.

Read the rest of this article »

No Comments

How Many Temp Allocators Are there?

Tags: , , , ,

Last time we saw that jobs apparently have their own Temp allocator. Still, it was unclear how many of these allocators there are. One per job job? One per thread? Just one? Today we’ll run an experiment to find the answer!

Read the rest of this article »

No Comments

Job-Safe APIs in Unity 2019.3

Tags: , ,

Today’s article continues the series by finding all the job-safe APIs in the Unity engine as of 2019.3. We’ll compare against 2019.1 to see what’s new!

Read the rest of this article »

No Comments

Temp Memory Reuse

Tags: , , , ,

Temp memory is backed by a fixed size block that’s cleared by Unity every frame. Allocations on subsequent frames return pointers to this same block. The allocated memory therefore isn’t unique. How much of a problem is this? Today we’ll do some experiments to find out!

Read the rest of this article »

No Comments

Allocating Memory Within a Job: Part 2

Tags: , , , ,

Last week’s article came to the conclusion that allocating Temp memory from within a job was safe. This week we’ll look into that a little deeper to find out that it might not be as safe as it looks!

Read the rest of this article »

No Comments

Allocating Memory Within a Job

Tags: , , , ,

What do you do when a job you’re writing needs to allocate memory? You could allocate it outside of the job and pass it in, but that presents several problems. You can also allocate memory from within a job. Today we’ll look into how that works and some limitations that come along with it.

Read the rest of this article »

2 Comments