Re: [swift-dev] Implementation of Type Erasers

2016-09-15 Thread Dave Abrahams via swift-dev
on Tue Sep 06 2016, Chris Eidhof wrote: > Thanks! That explains a lot. > > In my version, performance only is improved by 10%, so I'm not sure if the > tradeoff is worth it: > > In the isolated case of AnyIterator, there's only one method, so the sizeof > is the same (and the performance is

Re: [swift-dev] Implementation of Type Erasers

2016-09-06 Thread Chris Eidhof via swift-dev
Thanks! That explains a lot. In my version, performance only is improved by 10%, so I'm not sure if the tradeoff is worth it: In the isolated case of AnyIterator, there's only one method, so the sizeof is the same (and the performance is worth it). In the case of AnySequence, it would be a lot

Re: [swift-dev] Implementation of Type Erasers

2016-09-05 Thread Dmitri Gribenko via swift-dev
On Mon, Sep 5, 2016 at 11:13 AM, Chris Eidhof via swift-dev wrote: > Hello swift-dev, > > I was wondering why type erasers (e.g. for AnyIterator) are implemented the > way they are. I would implement AnyIterator like this: > > final class MyAnyIterator: IteratorProtocol { >