Monday, August 5, 2019 [Tweets] [Favorites]

Performance of Combine

quickbirdstudios (via Peter Steinberger):

This project contains a benchmarking test suite for comparing the performance of the most commonly used components and operators in RxSwift and Combine. For a detailed comparison of RxSwift with Combine have a look at our blog post.

[…]

As a summary Combine was faster in every test and on average 4,5x more performant than RxSwift.

You can also use the two test files as a Rosetta stone.

Previously:

Update (2019-08-06): Matt Gallagher:

The numbers on that page are generated in Debug builds.

I’m disappointed that people are repeating values so uncritically. Built in Release, those tests show Combine to be slightly faster than RxSwift but not by much.

Matt Gallagher:

The biggest change I would suggest for most of the tests is to put the Publisher/Subscribe/Cancel outside the measure closure. These can be expensive but are done only once so only matter in specific scenarios.

Matt Gallagher:

Reactive programming frameworks have different specialities. I have test cases where RxSwift is 3 times faster. I have test cases where Combine is 5 times faster.

1 Comment

Yes, but how does it compare to binding on the Mac? ;-)

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment