Is there any optimization like NSFastEnumeration (batch fetching, detecting mutations) in Swift? SequenceType doesn’t seem to do that.
-
-
@mjtsai I think you can consider a Generator to be the equivalent of NSFastEnumerationState.0 replies 0 retweets 0 likes -
-
@mjtsai The generator can batch & detect mutations. Often it’ll live on the stack, so .next() is not much worse than incrementing the ptr.0 replies 0 retweets 0 likes -
@rob_rix that slow or that the batching isn’t that worth it.0 replies 0 retweets 0 likes -
@mjtsai As I understand it, it doesn’t necessarily have to send a message. It may not even need indirection through a vtable.0 replies 0 retweets 0 likes -
@mjtsai And if it’s dispatched statically it can be inlined.0 replies 0 retweets 0 likes -
@mjtsai And it’s more composable since batching/mutation detection implementation details aren’t surfaced in the generator API.0 replies 0 retweets 0 likes
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.
Michael Tsai
Rob Rix