Is it possible to use the Job System in the editor code to speed up

Hey! Brothers! Is it possible to use the Job system in the editor code to speed up tasks? If so, what limitations does it have compared to using the Job system at runtime?

Yes, Iā€˜ve done so in the past. Burst also works great, which is often times the greatest boost. If I recall the main drawback is that the safety checks are always enabled, you can only temporarily disable them through the menu.

So you have to expect the code wonā€˜t perform as well as in runtime. But itā€˜s still pretty fast. However, if you use the same code for editor and runtime, you can only optimize it for one or the other. This is true for all such code but with Job system you may be at greater risk to optimize something for the editor that will not nearly perform as well at runtime, or vice versa.

And generally, you can only speed up Job System compatible code. 99% of the Unity API isnā€˜t compatible, with notable exceptions like the Mesh.MeshData API.

1 Like

Thank you, my intention was to iterate through multiple large arrays of vertices to write some information. This needs to be optimized, so Iā€™m pinning my hopes on the job system

Yup, vertices work great. I did a Jobs-enabled mesh generator based on Blenderā€™s BMesh: GMesh. It was mainly intended for editor work, eg a node graph for generating low-poly art not unlike Blenderā€™s generative node graph system.

Got some resources or links on how to do this?

Just the code in my repository.

I put the pieces together from various resources. I guess some will come up if you search for ā€œUnity Mesh Jobsā€ or ā€œUnity MeshData Jobsā€.

Burst/jobs for editor tools work great! Iā€™m seeing more and more assets/packages leverage it, too.

While this very rarely makes a difference (and almost never matters in editor code), these days you can disable safety checks using an option on the BurstCompile attribute.