Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Any thoughs on Iterator prefetching?

by pKai (Priest)
on Jun 25, 2009 at 13:42 UTC ( #774717=note: print w/ replies, xml ) Need Help??


in reply to Any thoughs on Iterator prefetching?

A wise man once said: "Prediction is hard, especially about the future."

A look into the source of Iterator shows, that it is implemented as you described (one value look ahead internally).

Doing it this way seems questionable.


Update: It seems that he needs the look ahead to be able to return undef as a valid value telling it apart from Iterator-exhausted.

So maybe you are better of with Iterator::Simple which cannot yield undef, but will also not look ahead.


Comment on Re: Any thoughs on Iterator prefetching?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://774717]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-02 00:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls