This is very good idea!
As you written I've inserted the CProfileManager::dumpAll(); that occur each 10sec.
I did two test, and I've registered the first tick of each test.
The first test I did I've used the broad phase check that avoid collisions between Ghost to Static body, and the result is this:
No lag
Code: Select all
----------------------------------
Profiling: Root (total running time: 1.817 ms) ---
0 -- btConvexConcaveCollisionAlgorithm::processCollision (0.00 %) :: 0.000 ms / frame (0 calls)
1 -- internalSingleStepSimulation (99.23 %) :: 1.803 ms / frame (1 calls)
2 -- btHashedOverlappingPairCache::processAllOverlappingPairs (0.00 %) :: 0.000 ms / frame (0 calls)
3 -- convexSweepTest (0.00 %) :: 0.000 ms / frame (0 calls)
Unaccounted: (0.771 %) :: 0.014 ms
...----------------------------------
...Profiling: btConvexConcaveCollisionAlgorithm::processCollision (total running time: 0.000 ms) ---
...0 -- btConvexTriangleCallback::processTriangle (0.00 %) :: 0.000 ms / frame (0 calls)
...Unaccounted: (0.000 %) :: 0.000 ms
...----------------------------------
...Profiling: internalSingleStepSimulation (total running time: 1.803 ms) ---
...0 -- updateActivationState (0.06 %) :: 0.001 ms / frame (1 calls)
...1 -- updateActions (0.00 %) :: 0.000 ms / frame (1 calls)
...2 -- integrateTransforms (0.22 %) :: 0.004 ms / frame (1 calls)
...3 -- solveConstraints (3.38 %) :: 0.061 ms / frame (1 calls)
...4 -- calculateSimulationIslands (0.39 %) :: 0.007 ms / frame (1 calls)
...5 -- performDiscreteCollisionDetection (91.18 %) :: 1.644 ms / frame (1 calls)
...6 -- createPredictiveContacts (0.11 %) :: 0.002 ms / frame (1 calls)
...7 -- predictUnconstraintMotion (0.22 %) :: 0.004 ms / frame (1 calls)
...Unaccounted: (4.437 %) :: 0.080 ms
......----------------------------------
......Profiling: solveConstraints (total running time: 0.061 ms) ---
......0 -- solveGroup (81.97 %) :: 0.050 ms / frame (1 calls)
......1 -- processIslands (4.92 %) :: 0.003 ms / frame (1 calls)
......2 -- islandUnionFindAndQuickSort (9.84 %) :: 0.006 ms / frame (1 calls)
......Unaccounted: (3.279 %) :: 0.002 ms
.........----------------------------------
.........Profiling: solveGroup (total running time: 0.050 ms) ---
.........0 -- solveGroupCacheFriendlyIterations (8.00 %) :: 0.004 ms / frame (1 calls)
.........1 -- solveGroupCacheFriendlySetup (88.00 %) :: 0.044 ms / frame (1 calls)
.........Unaccounted: (4.000 %) :: 0.002 ms
......----------------------------------
......Profiling: performDiscreteCollisionDetection (total running time: 1.644 ms) ---
......0 -- dispatchAllCollisionPairs (95.56 %) :: 1.571 ms / frame (1 calls)
......1 -- calculateOverlappingPairs (0.12 %) :: 0.002 ms / frame (1 calls)
......2 -- updateAabbs (4.32 %) :: 0.071 ms / frame (1 calls)
......Unaccounted: (0.000 %) :: 0.000 ms
.........----------------------------------
.........Profiling: dispatchAllCollisionPairs (total running time: 1.571 ms) ---
.........0 -- btHashedOverlappingPairCache::processAllOverlappingPairs (99.94 %) :: 1.570 ms / frame (1 calls)
.........Unaccounted: (0.064 %) :: 0.001 ms
............----------------------------------
............Profiling: btHashedOverlappingPairCache::processAllOverlappingPairs (total running time: 1.570 ms) ---
............0 -- btConvexConcaveCollisionAlgorithm::processCollision (0.06 %) :: 0.001 ms / frame (1 calls)
............1 -- btCompoundCompoundLeafCallback::Process (74.14 %) :: 1.164 ms / frame (82 calls)
............Unaccounted: (25.796 %) :: 0.405 ms
...............----------------------------------
...............Profiling: btCompoundCompoundLeafCallback::Process (total running time: 1.164 ms) ---
...............0 -- btConvexConcaveCollisionAlgorithm::processCollision (5.67 %) :: 0.066 ms / frame (14 calls)
...............Unaccounted: (94.330 %) :: 1.098 ms
..................----------------------------------
..................Profiling: btConvexConcaveCollisionAlgorithm::processCollision (total running time: 0.066 ms) ---
..................0 -- btConvexTriangleCallback::processTriangle (59.09 %) :: 0.039 ms / frame (20 calls)
..................Unaccounted: (40.909 %) :: 0.027 ms
......----------------------------------
......Profiling: createPredictiveContacts (total running time: 0.002 ms) ---
......0 -- release predictive contact manifolds (0.00 %) :: 0.000 ms / frame (1 calls)
......Unaccounted: (100.000 %) :: 0.002 ms
...----------------------------------
...Profiling: convexSweepTest (total running time: 0.000 ms) ---
...0 -- convexSweepCompound (0.00 %) :: 0.000 ms / frame (0 calls)
...Unaccounted: (0.000 %) :: 0.000 ms
The second test I did I've removed this code in order to allow Static Rigid body to be overlaped by a ghost and the result is:
Lag
Code: Select all
----------------------------------
Profiling: Root (total running time: 316787.438 ms) ---
0 -- btConvexConcaveCollisionAlgorithm::processCollision (0.00 %) :: 0.000 ms / frame (0 calls)
1 -- internalSingleStepSimulation (0.07 %) :: 209.717 ms / frame (1 calls)
2 -- btHashedOverlappingPairCache::processAllOverlappingPairs (0.00 %) :: 0.000 ms / frame (0 calls)
3 -- convexSweepTest (0.00 %) :: 0.000 ms / frame (0 calls)
Unaccounted: (99.934 %) :: 316577.719 ms
...----------------------------------
...Profiling: btConvexConcaveCollisionAlgorithm::processCollision (total running time: 0.000 ms) ---
...0 -- btConvexTriangleCallback::processTriangle (0.00 %) :: 0.000 ms / frame (0 calls)
...Unaccounted: (0.000 %) :: 0.000 ms
...----------------------------------
...Profiling: internalSingleStepSimulation (total running time: 209.717 ms) ---
...0 -- updateActivationState (0.00 %) :: 0.000 ms / frame (1 calls)
...1 -- updateActions (0.00 %) :: 0.000 ms / frame (1 calls)
...2 -- integrateTransforms (0.00 %) :: 0.006 ms / frame (1 calls)
...3 -- solveConstraints (0.05 %) :: 0.105 ms / frame (1 calls)
...4 -- calculateSimulationIslands (0.01 %) :: 0.016 ms / frame (1 calls)
...5 -- performDiscreteCollisionDetection (99.86 %) :: 209.425 ms / frame (1 calls)
...6 -- createPredictiveContacts (0.00 %) :: 0.002 ms / frame (1 calls)
...7 -- predictUnconstraintMotion (0.00 %) :: 0.003 ms / frame (1 calls)
...Unaccounted: (0.076 %) :: 0.160 ms
......----------------------------------
......Profiling: solveConstraints (total running time: 0.105 ms) ---
......0 -- solveGroup (27.62 %) :: 0.029 ms / frame (1 calls)
......1 -- processIslands (3.81 %) :: 0.004 ms / frame (1 calls)
......2 -- islandUnionFindAndQuickSort (66.67 %) :: 0.070 ms / frame (1 calls)
......Unaccounted: (1.905 %) :: 0.002 ms
.........----------------------------------
.........Profiling: solveGroup (total running time: 0.029 ms) ---
.........0 -- solveGroupCacheFriendlyIterations (17.24 %) :: 0.005 ms / frame (1 calls)
.........1 -- solveGroupCacheFriendlySetup (79.31 %) :: 0.023 ms / frame (1 calls)
.........Unaccounted: (3.448 %) :: 0.001 ms
......----------------------------------
......Profiling: performDiscreteCollisionDetection (total running time: 209.425 ms) ---
......0 -- dispatchAllCollisionPairs (99.96 %) :: 209.351 ms / frame (1 calls)
......1 -- calculateOverlappingPairs (0.00 %) :: 0.002 ms / frame (1 calls)
......2 -- updateAabbs (0.03 %) :: 0.071 ms / frame (1 calls)
......Unaccounted: (0.000 %) :: 0.001 ms
.........----------------------------------
.........Profiling: dispatchAllCollisionPairs (total running time: 209.351 ms) ---
.........0 -- btHashedOverlappingPairCache::processAllOverlappingPairs (100.00 %) :: 209.350 ms / frame (1 calls)
.........Unaccounted: (0.000 %) :: 0.001 ms
............----------------------------------
............Profiling: btHashedOverlappingPairCache::processAllOverlappingPairs (total running time: 209.350 ms) ---
............0 -- btConvexConcaveCollisionAlgorithm::processCollision (0.00 %) :: 0.001 ms / frame (1 calls)
............1 -- btCompoundCompoundLeafCallback::Process (97.37 %) :: 203.853 ms / frame (1500 calls)
............Unaccounted: (2.625 %) :: 5.496 ms
...............----------------------------------
...............Profiling: btCompoundCompoundLeafCallback::Process (total running time: 203.853 ms) ---
...............0 -- btConvexConcaveCollisionAlgorithm::processCollision (98.09 %) :: 199.961 ms / frame (1431 calls)
...............Unaccounted: (1.909 %) :: 3.892 ms
..................----------------------------------
..................Profiling: btConvexConcaveCollisionAlgorithm::processCollision (total running time: 199.961 ms) ---
..................0 -- btConvexTriangleCallback::processTriangle (96.58 %) :: 193.128 ms / frame (10065 calls)
..................Unaccounted: (3.417 %) :: 6.833 ms
......----------------------------------
......Profiling: createPredictiveContacts (total running time: 0.002 ms) ---
......0 -- release predictive contact manifolds (0.00 %) :: 0.000 ms / frame (1 calls)
......Unaccounted: (100.000 %) :: 0.002 ms
...----------------------------------
...Profiling: convexSweepTest (total running time: 0.000 ms) ---
...0 -- convexSweepCompound (0.00 %) :: 0.000 ms / frame (0 calls)
...Unaccounted: (0.000 %) :: 0.000 ms
As you can see there is an increment in time spent from here:
btHashedOverlappingPairCache::processAllOverlappingPairs to
btConvexConcaveCollisionAlgorithm::processCollision
But this doesn't tell me much more. What do you think about this stats?
If you want you can join in "developer Godot IRC" so it's more easy to talk. Just ASK for me in chat