Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61842 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27562 invoked from network); 27 Jul 2012 16:35:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2012 16:35:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.161.170 mail-gg0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:58346] helo=mail-gg0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/F7-14209-A63C2105 for ; Fri, 27 Jul 2012 12:35:55 -0400 Received: by ggnf2 with SMTP id f2so3964457ggn.29 for ; Fri, 27 Jul 2012 09:35:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=QKrLP0E1RpzM3cyOmJEEN6vefLR6lVslDJ5SymiFtFA=; b=dQahxPIDhbmaWX48rs2Bbx9Mk7L6X3gyxmQbmdYJjSBNv2fkTi1fa/5NfrRhkTebeT EQaWjeEzrYvZIJHsbSIhiXwI2bJ+gr4GSFAucwKI6pYlnmusCCclV9iOU7dLLr2fkK2K 9bYkhO22BraUWa50W/hAQ6ODupa60L7SdIu/NJzUZZVdRvw7/JVBSNMkJYkb/rl2jW8e 7WcSsiATprnS2z7m9gYjdeNbu2KZL//A0iZ1nlcY1D/yLZVi0NIUbqBCPgoBvFCZOQVD 7IuKfVErrX/uSwxX1hqN0uX214UZZfhTbJuXsisoAPtM1Lsodz/ZvJ0gfAiNpmxSkPbf uyfA== MIME-Version: 1.0 Received: by 10.50.158.195 with SMTP id ww3mr2141799igb.52.1343406951271; Fri, 27 Jul 2012 09:35:51 -0700 (PDT) Sender: php@golemon.com Received: by 10.64.16.35 with HTTP; Fri, 27 Jul 2012 09:35:50 -0700 (PDT) X-Originating-IP: [2620:0:1cfe:28:e157:2bd3:fe7:af18] In-Reply-To: <50129EE0.7030500@lsces.co.uk> References: <500EEA76.1030407@ajf.me> <5010138D.5050804@ajf.me> <501015B9.6050704@ajf.me> <501058B9.5050004@lsces.co.uk> <501249B6.5070507@lsces.co.uk> <50128825.4020902@lsces.co.uk> <50129EE0.7030500@lsces.co.uk> Date: Fri, 27 Jul 2012 09:35:50 -0700 X-Google-Sender-Auth: D4V1wWuhFGv-r9UxPV1nc5SnDok Message-ID: To: Lester Caine Cc: PHP internals Content-Type: multipart/alternative; boundary=14dae93406411e8ea404c5d24e81 X-Gm-Message-State: ALoCoQkbm7WLKejVgFbdvYp8S5nQrYVBAwX9AmzHZi7ahzNSiDAnnM8Jft1nXDdFUob2uXbXbNym Subject: Re: [PHP-DEV] Re: Generators in PHP From: pollita@php.net (Sara Golemon) --14dae93406411e8ea404c5d24e81 Content-Type: text/plain; charset=ISO-8859-1 > > >> 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 --14dae93406411e8ea404c5d24e81--