Created
November 25, 2016 20:03
-
-
Save andersio/9b3f64754e4f35437673fe78a693209f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import XCTest | |
| import Result | |
| import ReactiveSwift | |
| class AtomicPerfTests: XCTestCase { | |
| func test1() { | |
| let a = Atomic<(Int, Int)?>(nil) | |
| let i = Atomic<(Int, Int)?>((1, 1)) | |
| let obv = Observer<(), NoError> { _ in | |
| if let _ = i.value { | |
| _ = a.swap(nil) | |
| } | |
| } | |
| measure { | |
| for _ in 0 ..< 1000000 { | |
| obv.send(value: ()) | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment