[Job System] What is CheckElementReadAccess()?

Hey there,

i was profiling my C# job system implementation of a custom spring physics simulation and the most expensive operation seems to be “NativeArray’1.CheckElementReadAccess()”.
Im curious what that might be (besides the obvious fact that it checks if it has read access ofc. :smile: )? All NativeArrays im using are [ReadOnly], why does it have to check them each time then? Is there something i can do to minimize this?

Greetings,
Desoxi

that is an editor/debug check that prevents race conditions etc. @Joachim_Ante_1 has many posts in this forum about that.

if you make a release build (always profile in a release build) it should disappear.

you can also disable them in the editor (Jobs menu if I remember right) but if you make a mistake you could crash the editor (and it will stop detecting race conditions)

Ohh i see, didnt find it through the search, maybe i used the wrong keywords. Thanks for the answer!