@ayanonagon @irace 3 mins that's a lot, and all is syntax changes?
-
-
-
@KostiaKoval Yeeeep. Unfortunate thing is that isActive = true is slower at runtime, so we’re trading off compile time with run time :/ - View other replies
-
@ayanonagon@KostiaKoval isn't it more important to make the user's experience better than the developer's? - View other replies
-
@abizern@KostiaKoval It is, so I’m writing ugly code.
-
@ayanonagon btw, docs:"Typically, using this method is more efficient than activating each constraint individually." https://developer.apple.com/reference/uikit/nslayoutconstraint/1526955-activateconstraints … - View other replies
-
@KostiaKoval Yeahhhh that’s right. We ended up rewriting as var constraints = [NSLayoutConstraint]() then constraints.append
-
-
-
Basically had to go back & change most of our NSLayoutConstraint.activate to isActive = true. Uglier, but it really added up over time…

- View other replies
-
@ayanonagon with a map it shouldn't be so ugly, or is it? -
@KostiaKoval Map on what? Making the array itself is the slow part.
-
@ayanonagon ohh, I see :( tradeoffs Speed vs Readability
https://twitter.com/KentBeck/status/702662471547355137 …
-
-
-
.
@ayanonagon@irace I just tried it. Turns out { $0 == "e" || $0== "E" } takes 100ms more than { (c: Character) in c == "e" || c == "E" } - View other replies
-
@ayanonagon@irace to be clear, that's for *every* instance. I had a function in SwiftFormat that has four of those; went from 400ms to 10ms - View other replies
-
@ayanonagon@irace also, it's not a general problem using $0, it's the ||. This is an equally fast option: { "eE".characters.contains($0) } -
@nicklockwood@ayanonagon@irace Hmm, I'm thinking it may have more to do with the Character literals combined with the ||. -
@harlanhaskins@ayanonagon@irace yes, I think the root issue is that too many things are stringLiteralConvertible, so many possible matches
-
-
@ayanonagon@irace in my case the biggest time consumer was nil-coalescing with optionals. Like (self.param?.param ?? “”) -
@ayanonagon@irace@vixentael And there's a https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode … tool for that too. -
@ayanonagon@nicklockwood@irace Can you tell me what the before/after times were? Roughly what size proj.? Thanks! -
@ayanonagon some things we did: final, declaring extensions in a single file, remove lazy vars, not using type inference (dictionaries)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Ayaka Nonaka
Kostiantyn Koval
Abizer Nasir
Nick Lockwood
Harlan Haskins
Lluis Gerard
Paul Taykalo
Marcel Weiher
Bryan Irace
Shagun Madhikarmi