Fetch-on-demand iterators (was Re: [CDBI] Make CDBI go fast)

Michael G Schwern schwern at gmail.com
Fri Feb 16 02:24:37 GMT 2007


Tim Bunce wrote:
>> This new iterator code does not do any extra trips to the database.  It should result in pretty much the same performance as before even when you do run through the whole iterator (its currently a bit slower.  I'm working on that).
> 
> It's possibly slower because you're using fetchrow_hashref.
> 
> If you weren't then it might even be faster than the old code
> because you're avoiding the need to allocate storage for the rows.

I've considered that.  Also I wrote the sth iterator as part of the existing list iterator.  So it continues to support the old Iterator interface which is problematic.  It means I have to store each row as it comes out to support reset().  I will probably just write a whole new iterator class and not support reset().

Profiling will tell all.



More information about the ClassDBI mailing list