Skip to content

[Collision.Detection] SubCollisionPipeline: fix timings#6019

Open
fredroy wants to merge 3 commits intosofa-framework:masterfrom
fredroy:timer_subpipelines
Open

[Collision.Detection] SubCollisionPipeline: fix timings#6019
fredroy wants to merge 3 commits intosofa-framework:masterfrom
fredroy:timer_subpipelines

Conversation

@fredroy
Copy link
Contributor

@fredroy fredroy commented Mar 16, 2026

Before the PR, if there was more than 1 subcollisionpipeline, timers were mixed-up because the string ID were the same:
(on the CompositeCollisionPipeline example):

....
4   	   0   	   3   	   0   	   0   	   0   	   0   	   0   	   9.14	....doCollisionDetection
   5   	   0   	   2   	   0   	   0   	   0   	   0   	   0   	   3.86	.....ComputeBoundingTree
   6   	   0   	   2   	   0   	   0   	   0   	   0   	   0   	   1.10	......Compute BoundingTree: sphere
   6   	   0   	   2   	   0   	   0   	   0   	   0   	   0   	   0.14	......Compute BoundingTree: triangle_collision
   6   	   0   	   2   	   0   	   0   	   0   	   0   	   0   	   0.13	......Compute BoundingTree: line_collision
   6   	   0   	   2   	   0   	   0   	   0   	   0   	   0   	   0.15	......Compute BoundingTree: point_collision
   5   	   0   	   2   	   0   	   0   	   0   	   0   	   0   	   1.64	.....BroadPhase
   5   	   0   	   2   	   0   	   0   	   0   	   0   	   0   	   0.07	.....NarrowPhase
   3   	   0.01	   2   	   0   	   0   	   0   	   0   	   0   	   0.30	...CreateContacts
...

we can see that:

  • the sum of computeBoundingTree is bogus (3.86 and 1.1+0.14+0.13+0.15 = 1.52)
  • the total sim of everything under doCollisionDetection is incorrect as well ( the sum of the children does not equal 9.14)

So now this PR adds a suffix to identify and separate timer computations, and allows better readings:

....
3   	   0   	   1   	   0   	   0.01	   0   	   0   	   0   	   7.33	...doCollisionDetection
   4   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   3.50	....[collision_pipeline_large] doCollisionDetection
   5   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   2.35	.....[collision_pipeline_large] ComputeBoundingTree
   6   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   0.52	......[collision_pipeline_large] Compute BoundingTree: sphere
   6   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   0.08	......[collision_pipeline_large] Compute BoundingTree: triangle_collision
   6   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   0.11	......[collision_pipeline_large] Compute BoundingTree: line_collision
   6   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   0.07	......[collision_pipeline_large] Compute BoundingTree: point_collision
   5   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   0.82	.....[collision_pipeline_large] BroadPhase
   5   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   0.03	.....[collision_pipeline_large] NarrowPhase
   4   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   3.36	....[collision_pipeline_small] doCollisionDetection
   5   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   2.19	.....[collision_pipeline_small] ComputeBoundingTree
   6   	   0   	   1   	   0   	   0   	   0   	   0   	   0   	   0.60	......[collision_pipeline_small] Compute BoundingTree: sphere
   6   	   0.01	   1   	   0   	   0   	   0   	   0   	   0   	   0.07	......[collision_pipeline_small] Compute BoundingTree: triangle_collision
   6   	   0.01	   1   	   0   	   0   	   0   	   0   	   0   	   0.06	......[collision_pipeline_small] Compute BoundingTree: line_collision
   6   	   0.01	   1   	   0   	   0   	   0   	   0   	   0   	   0.07	......[collision_pipeline_small] Compute BoundingTree: point_collision
   5   	   0.01	   1   	   0   	   0   	   0   	   0   	   0   	   0.83	.....[collision_pipeline_small] BroadPhase
   5   	   0.01	   1   	   0   	   0   	   0   	   0   	   0   	   0.06	.....[collision_pipeline_small] NarrowPhase
   3   	   0.01	   2   	   0   	   0   	   0   	   0   	   0   	   0.26	...CreateContacts
....

as a side note, it would be good to have a standard for formatting timers (lowercase, uppercase, component name, etc)


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code labels Mar 16, 2026
@fredroy fredroy force-pushed the timer_subpipelines branch from 640d18d to df52b34 Compare March 16, 2026 07:17
@fredroy fredroy force-pushed the timer_subpipelines branch from df52b34 to 837e4b0 Compare March 16, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: clean Cleaning the code pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant