I know that the IteratorIterator class was deprecated some time ago in
favor of WrappedIterator.createIteratorIterator(). However they have
different performance characteristics.

the original IteratorIterator, did not call iter.next() on the base
iterator until it was needed.  createIteratorIterator() creates the
iterators using the (iter.next()).andThen( iter.next() ) type construct.
Basically calling next() on the base iterator to create an iterator over
the results.

The problem is that when the base iterator is returning expensive (or very
memory hungry) iterators they are all loaded before the final iterator is
ready for use.

I know that there is a lazy iterator but I don't see how to use that to
solve the problem.

I propose we bring back the IteratorIterator and describe when to use it.

Claude

-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Reply via email to