reactphysics3d icon indicating copy to clipboard operation
reactphysics3d copied to clipboard

Sim step slowing down

Open ghost opened this issue 2 years ago • 7 comments

I have about 1000 box colliders, but they're all (a) static and (b) not set to collide with each other. However the world step has gotten very slow. Is RP3D not ok with large numbers of objects in general?

ghost avatar Jul 14 '23 14:07 ghost

Are any of the objects moving? Or is the whole scene static? Can you profile the code to see where time is being spent? Also make sure you're testing a Release build. Debug builds have extra overhead which make the program much slower.

Let me know if you need help figuring out how to profile the program.

programingman avatar Jul 14 '23 23:07 programingman

They're static. But yes I'm in debug mode. Maybe I need to compile rp3d in release and my code in debug. I'll run gprof though and see what comes out.

ghost avatar Jul 15 '23 06:07 ghost

Can I disable the debugging stuff while remaining in non-release build?

ghost avatar Jul 15 '23 14:07 ghost

You can enable optimization (eg -O2 or -O3) on the rp3d Debug library, but mixing Debug and Release builds isn't recommended, if it will compile at all.

programingman avatar Jul 15 '23 23:07 programingman

Thanks. I turned off debug drawing - are there any other options like that I might have missed that are on by default?

ghost avatar Jul 16 '23 08:07 ghost

Try profiling with the orbit profiler to find out where most of the time is being spent.!

ZeunO8 avatar Jul 22 '23 02:07 ZeunO8

Have you already tried the last release of the library (version v0.10.0)?. I have made a change that has improved a lot the performance of static bodies.

DanielChappuis avatar Jun 14 '24 05:06 DanielChappuis