Created
November 28, 2015 20:12
-
-
Save almostintuitive/0534e7e8329a7f9b3ca0 to your computer and use it in GitHub Desktop.
Imperative vs. FRP swift performance
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
func test1Imperative() { | |
class Counter { | |
var count: Int = 0 { | |
didSet { | |
realCount = count+1 | |
} | |
} | |
var realCount: Int = 0 | |
} | |
var counter = Counter() | |
for i in 1..<100000 { | |
counter.count = i | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment