allSatisfy vs contains in performance terms

I've read the replies and checked the implementation mentioned and I arrived to the next conclusions:

  • allSatisfy({}) -> calls contains(where: {}) with inverting the logic of predicate and result. (As mentioned in previous post)
  • contains(_ element:) also calls contains(where: {}) contains(_ element:) implementation
  • If Sequence is composed of Equatable elements and capable of direct access to element, contains(_ element:) will use _customContainsEquatableElement to retrieve the result. Array, as I see, does not have implemented this method, so will behave like contains(where: {}).

In short: all of them have the same performance in Array and only will get improvement using contains(_ element:) if using another type of Sequence with Equatable elements.

Thank you everyone.