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.
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.