Re: Re: Generators in PHP

From: Date: Fri, 27 Jul 2012 16:35:50 +0000
Subject: Re: Re: Generators in PHP
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  Groups: php.internals 
Request: Send a blank email to internals+get-61842@lists.php.net to get a copy of this message
> > >> 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! > > I hear your concerns about performance, and you're good to have them. So to look at a real-world code base, I'd offer Facebook where we transformed our data fetching classes from a form of iterator to use generators. The result (exclusive of underlying data fetch) was nearly even, with a slight gain on the side of generators (sadly no, I can't share the raw data with you). Of course, this is also meaningless since we're talking about the HipHop implementation of generators and not PHP's, but there you go. -Sara

« previous php.internals (#61842) next »