<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div>Hi Erica,</div><div><br class=""></div><div>Just a quick side note with regards to:</div><div><br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Dmitri adds: "<span class="" style="font-family: Palatino-Roman;"><i class="">You can use AnySequence and AnyGenerator, but they come at a cost of dynamic dispatch for every call.&nbsp; In this case, if you want this component to be suitable for performance-critical code, I would suggest to avoid them for now.</i>"</span></div></div></blockquote><br class=""></div><div>This is very much true. But since Swift 2.0, that overhead can actually be avoided for AnyGenerator given enough context.</div><div><br class=""></div><div>Basically, if the producer and consumer of the sequence are in the same module and with whole module optimization enabled (or putting all the relevant parts in the same file), AnyGenerator can be as fast as a native generator.</div><div><br class=""></div><div>It's of limited usefulness and a bit weird to use AnyGenerator instead of AnySequence but it can be handy when:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>* performance is critical,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>* you want to use more than one sequence type (with different generators)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>* and can't use generic functions to solve your problem...</div><br class=""><div class="">
<div class="">- Janosch</div>
</div>
<br class=""></body></html>