All Projects → quickbirdstudios → Combinerxswiftperformance

quickbirdstudios / Combinerxswiftperformance

A test suite comparing the performance of Combine and RxSwift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Combinerxswiftperformance

Rerxswift
ReRxSwift: RxSwift bindings for ReSwift
Stars: ✭ 97 (-37.01%)
Mutual labels:  reactive-programming, rxswift, frp, functional-reactive-programming
ObservableComputations
Cross-platform .NET library for computations whose arguments and results are objects that implement INotifyPropertyChanged and INotifyCollectionChanged (ObservableCollection) interfaces.
Stars: ✭ 94 (-38.96%)
Mutual labels:  reactive-programming, functional-reactive-programming, rx
Rxmarvel
Playing around marvel public API with RxSwift, Argo, Alamofire
Stars: ✭ 86 (-44.16%)
Mutual labels:  rxswift, rx, functional-reactive-programming
WhatFilm
Simple iOS app using TMDb API and RxSwift
Stars: ✭ 35 (-77.27%)
Mutual labels:  rxswift, reactive-programming, functional-reactive-programming
purescript-pop
😃 A functional reactive programming (FRP) demo created with PureScript events and behaviors.
Stars: ✭ 33 (-78.57%)
Mutual labels:  reactive-programming, functional-reactive-programming, frp
Swiftrex
Swift + Redux + (Combine|RxSwift|ReactiveSwift) -> SwiftRex
Stars: ✭ 267 (+73.38%)
Mutual labels:  reactive-programming, rxswift, frp
fpEs
Functional Programming for EcmaScript(Javascript)
Stars: ✭ 40 (-74.03%)
Mutual labels:  reactive-programming, functional-reactive-programming, rx
Rxcombine
Bi-directional type bridging between RxSwift and Apple's Combine framework
Stars: ✭ 741 (+381.17%)
Mutual labels:  reactive-programming, rxswift, frp
Dynamicdata
Reactive collections based on Rx.Net
Stars: ✭ 1,083 (+603.25%)
Mutual labels:  reactive-programming, rx
Rxexamples
Tests with RxSwift by book of Ray Wenderlich
Stars: ✭ 66 (-57.14%)
Mutual labels:  reactive-programming, rxswift
Reactiveandroid
Reactive events and properties with RxJava for Android
Stars: ✭ 80 (-48.05%)
Mutual labels:  reactive-programming, frp
Rxswiftext
A collection of Rx operators & tools not found in the core RxSwift distribution
Stars: ✭ 1,080 (+601.3%)
Mutual labels:  reactive-programming, rxswift
Rxswift To Combine Cheatsheet
RxSwift to Apple’s Combine Cheat Sheet
Stars: ✭ 1,040 (+575.32%)
Mutual labels:  reactive-programming, rxswift
Rocket.jl
Functional reactive programming extensions library for Julia
Stars: ✭ 69 (-55.19%)
Mutual labels:  reactive-programming, functional-reactive-programming
Flutter validation login form bloc pattern rxdart
[Functional reactive programming (FRP)]💧 💧 💧 [Pure RxDart] Validation login form by using the BLoC pattern with RxDart - A new Flutter project featuring a faked authentication interface to demonstrate validation. Implemented with BloC pattern.
Stars: ✭ 45 (-70.78%)
Mutual labels:  reactive-programming, rx
Fluxxkit
Unidirectional data flow for reactive programming in iOS.
Stars: ✭ 42 (-72.73%)
Mutual labels:  reactive-programming, rxswift
Spring 5 Examples
This repository is contains spring-boot 2 / spring framework 5 project examples. Using reactive programming model / paradigm and Kotlin
Stars: ✭ 87 (-43.51%)
Mutual labels:  reactive-programming, functional-reactive-programming
Sodium Typescript
Typescript/Javascript implementation of Sodium FRP (Functional Reactive Programming) library
Stars: ✭ 102 (-33.77%)
Mutual labels:  frp, functional-reactive-programming
Moyamapper
快速解析模型工具,支持RxSwift。同时支持缓存功能 【相关手册 https://MoyaMapper.github.io 】
Stars: ✭ 115 (-25.32%)
Mutual labels:  rxswift, rx
Lightweightobservable
📬 A lightweight implementation of an observable sequence that you can subscribe to.
Stars: ✭ 114 (-25.97%)
Mutual labels:  reactive-programming, rx

Combine vs. RxSwift Performance Benchmark Test Suite 📊

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.

The RxSwift performance benchmark tests are the original ones used in the RxSwift project. We removed the two tests from RxCocoa testing Drivers, since there is no equivalent in Combine. The Combine tests are 1:1 translated tests from the Rx test-suite and should, therefore, be easily comparable.

Important update: As mentioned correctly the old numbers were created with XCTests running in DEBUG mode. The differences seem not so critical in Release builds. We have updated all the numbers and graphs to use release builds.

As a summary Combine was faster in every test and on average 41% more performant than RxSwift. These statistics show every test-method and its results. Lower is better.

Test Results Summary

Test RxSwift (ms) Combine (ms) Factor
PublishSubjectPumping 227 135 168%
PublishSubjectPumpingTwoSubscriptions 400 246 163%
PublishSubjectCreating 295 250 118%
MapFilterPumping 123 132 93%
MapFilterCreating 168 114 147%
FlatMapsPumping 646 367 176%
FlatMapsCreating 214 121 177%
FlatMapLatestPumping 810 696 116%
FlatMapLatestCreating 263 180 146%
CombineLatestPumping 298 282 106%
CombineLatestCreating 644 467 138%

Testing Details

Machine: MacBook Pro 2018, 2,7 GHz Intel Core i7, 16 GB IDE: Xcode 11.0 beta 5 (11M382q) Testing Device: iPhone XR Simulator

Performance Test Example: PublishSubject Pumping

For every test we replace the RxSwift component with the corresponding Combine component. In this case PublishSubject with PassthroughSubject.

RxSwift

func testPublishSubjectPumping() {
    measure {
        var sum = 0
        let subject = PublishSubject<Int>()

        let subscription = subject
            .subscribe(onNext: { x in
                sum += x
            })

        for _ in 0 ..< iterations * 100 {
            subject.on(.next(1))
        }

        subscription.dispose()

        XCTAssertEqual(sum, iterations * 100)
    }
}

Combine

func testPublishSubjectPumping() {
    measure {
        var sum = 0
        let subject = PassthroughSubject<Int, Never>()

        let subscription = subject
            .sink(receiveValue: { x in
                sum += x
            })

        for _ in 0 ..< iterations * 100 {
            subject.send(1)
        }
        
        subscription.cancel()
        
        XCTAssertEqual(sum, iterations * 100)
    }
}

Detailed Performance Test Results: RxSwift vs. Combine

PublishSubjectPumping

PublishSubjectPumpingTwoSubscriptions

PublishSubjectCreating

MapFilterPumping

MapFilterCreating

FlatMapsPumping

FlatMapsCreating

FlatMapLatestPumping

FlatMapLatestCreating

CombineLatestPumping

CombineLatestCreating

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].