Sherif Ramadan wrote:
https://wiki.php.net/rfc/generators#performance
"You can find a small micro benchmark at
https://gist.github.com/2975796. It compares several ways of iterating
ranges:"
What part of this discussion led you to believe such a ridiculous
argument as to why generator were introduced? I'm glad to see that
while seeking reason you are also demonstrating it.
The micro benchmark is just that, and is not as far as I can see testing the
sort of iterating process that would happen normally when going through a data
set. It simply times the iterator, but does not compare like with like!
The question I am asking is if USING 'xrange' to feed a feed a function and use
the results is faster than 'urange' simply using the iterator to call the
handling function DIRECTLY. To fix this benchmark what I am missing is how the
'yield' approach would be used to build the $result[] array. This may be obvious
to some of you, but I'm missing something to help me understand just what is
planned here :(
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php