The Unity Job System

The big block in the DOTS that can provide us with a huge performance-enhancing feature is the C# Job System. Like all the other DOTS components, the feature is still in active development, but has been made public since Unity 2019.1, so it would be wise to start becoming familiar with it sooner rather than later, as it will introduce considerable changes to how Unity developers will be writing high-performance code:

As we will see, the difference in the quality of a game that uses this system versus one that doesn't might become very noticeable, which may cause some fragmentation within the Unity development community. It is in our best interests to understand and exploit the benefits of the new Job System so that our application will have the greatest potential for success.

The idea of the C# Job System is to be able to create simple tasks that run in background threads to offload work from the main thread. The C# Job System will be ideal for tasks that are embarrassingly parallel, such as having hundreds of thousands of simple AI agents operating in a scene simultaneously and any problem that can be boiled down to thousands of small, independent operations. Of course, it can also be used for typical multithreading behavior as well, where we perform a number of calculations in the background that are not needed immediately. The Job System also introduces some compiler technology improvements to get an even greater performance boost than just moving the tasks to separate threads.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.93.210