02-04-2024, 11:14 AM
(This post was last modified: 02-04-2024, 11:18 AM by josemendez.)
(02-04-2024, 09:30 AM)ShawnF Wrote: Thanks for the heads up about maximum fixed timestep - I'll set it to 0.06 for now and read up on it a bit to make sure I understand it better.
In the meantime, here's the non-deep profiled versions:
Oni: https://drive.google.com/file/d/1Xp1TaIh...drive_link
Burst: https://drive.google.com/file/d/1H6sbukm...drive_link
Hi,
Finally realized the problem: since each rope is in its own solver, you're paying for job scheduling once per rope. Since ropes in your case seem to be fairly simple (maybe just a couple dozen constraints each or so?) Burst spends way more time scheduling threads than actually doing meaningful work. As a result you have small bursts of simulation interleaved with scheduling:
While Oni's simulation code is slower, it doesn't pay as much for thread scheduling since it doesn't use Unity's job system but C++'s std::thread, so it will be faster in situations where you have many solvers with very little work to do for each solver: in this case the bottleneck isn't the simulation itself, it's managing jobs.
Compare performance for both backends with a setup with 12 (still very simple) ropes in a single solver:
Burst:
Oni:
You can see timings are similar, both taking around 2.7 ms per frame. In this case I would advise to merge multiple ropes into a single solver if possible, otherwise you'll be paying for thread juggling since each solver has to push its own work onto Unity's job scheduler regardless of how little actual work it has to push.