Working with ECS, how should I treat collisions?

I’m working with ecs. And I want to treat collisions. I found two way.

  1. OnCollisionEnter in component
    (Not using ECS)
  2. Using GetContacts() to Each rigidbody of components
    (using ECS)

I’m wondering which one is performant.

I know that this is necropost, but the modern way of doing this would be through CollisionEvents and TriggerEvents (at least this is my preferred way).