23-02-2026, 12:05 PM
(20-02-2026, 10:55 PM)josemendez Wrote: Hi!
Scheduling jobs shouldn’t be anywhere as costly as 0.1 ms per job. Not sure why you mention friction constraints as an example of a “huge” job struct: it’s quite small, only a handful of NativeArrays are passed, which consist of just 2 integers each (memory address and count). That’s hardly enough data copying to even show up in the profiler.
Make sure to disable the jobs debugger though: enabling it will result exactly in the behavior you’re getting - scheduling jobs gets slower the more jobs you schedule in a frame, specially with long dependency chains. Everything will be considerably slower overall with debugging enabled.
Kind regards
Well, "huge" is relative term, I mean that my job struct is not even half as big as this one, but took way longer to schedule:
In any case you are right, disabling debugger removed stacked overhead, shame there is no button in editor and I need script for that.
Thanks!
Additional question - I noticed before that particle collision job is completed instantly and blocks main thread for very long time, is it possible to avoid this?
I see comment about fluid particles, but I don't use them, so is it possible to modify this code in some easy way to avoid this sync point?
Code:
if (simulateWhenInvisible || isVisible)
{
simulationHandle = implementation.CollisionDetection(simulationHandle, simulatedTime);
simulationHandle?.Complete(); // complete here, since several jobs need fluidParticles.Length. TODO: use deferred jobs.
}
