Hi,
Received your project and tested it.
You have 20+ attachment components per rope which is
overkill, the cost of having so many components per object which is not negligible. You also have 20 rigidbodies with 20 colliders, 20 joints, etc - per solver which is a lot of objects. A sizable part of the cost comes from these.
Note that if you simply want objects evenly spaced along the rope, there's a much simpler and cheaper way to do it: set the position of the object to a point along the rope. See ObiRopeAttach sample component for an example.
If you
really need that many attachments, create pin constraints
at runtime. This will circumvent the need to have so many components per object.
Still, in your project a single solver+rope runs at about 200 fps (5 ms/frame). Copying the entire solver once (2 solvers, 40 rigidbodies, etc) runs at 170 FPS (6 ms/frame): That's *only* 1 ms more. Having 5 copies of the solver runs at 95 FPS (10.5 ms/frame). Having 12, it runs at 40 FPS (24.8 ms/frame). It's not a performance issue, it's working as intended given how heavy the simulation is.
These measurements are without the 20+ attachments, rigidbodies, joints, etc per solver:
1 solver: 220 FPS
2 solvers:204 FPS
5 solvers: 165 FPS
12 solvers: 100 FPS
So the objects under each solver make a large difference: from 100 FPS without them, to 40 FPS with them.
Also note that relative performance must
never be measured using FPS, since FPS
don't scale linearly with performance.
Milliseconds/frame is the usual way to measure performance, as it's linear. For instance if your game is running at 200 FPS (5 ms/frame) and you add 2 ms/frame, that's 1/0.007 = 142 FPS. It would seem like a huge performance drop, but consider what happens when you add the same hit of 2 ms/frame to a game running at 60 FPS (16 ms/frame): 1/0.018 = 55 FPS. It's
only 5 FPS less.
So the
same performance hit that takes you from 200 FPS to 142 FPS, would take you from 60 FPS to 55 FPS.
kind regards,