Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62274 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35870 invoked from network); 20 Aug 2012 01:06:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Aug 2012 01:06:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:35678] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/6B-03087-38D81305 for ; Sun, 19 Aug 2012 21:06:12 -0400 Received: by weyr1 with SMTP id r1so4212282wey.29 for ; Sun, 19 Aug 2012 18:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8Lae+yMUTTG1dfhdUoEVfhQ+JKcTpLOMuOvEOk3T1x8=; b=FrQ7XL+BvRiXcc5U+f/NWX29O6wl886AojshKllqIc54b7zJ97rd4Le+0J+loilXn1 Cuf7u5PnHVtpECI35Te6B/AUgbTSwwTqgFyZ3+nZnFzFkWYF70D8ezs0TFSHKgNKK9mO gjPdK+nFmx9typQnUXGC38Dv8OO9Z3YhtPDw1piF4ErlO2ChGJdpJHBRuKgDWVOCLwtm p1YIgJzpQwJMDPv2JPILX/4cH+ku2j4NTU9wQaAPDgExpHNWmcm1VjgMYDMwAg8/GBk1 rBbXrY03TmEsnbFM1Y2Jt4QNJ+6+ohZyfm2NHxtD/GdYK5rqcFFPLq6quJNF2aiFZurc VJDA== MIME-Version: 1.0 Received: by 10.216.238.30 with SMTP id z30mr6517483weq.223.1345424768975; Sun, 19 Aug 2012 18:06:08 -0700 (PDT) Received: by 10.216.211.30 with HTTP; Sun, 19 Aug 2012 18:06:08 -0700 (PDT) In-Reply-To: References: <5030FFF2.1070507@lerdorf.com> Date: Sun, 19 Aug 2012 18:06:08 -0700 Message-ID: To: Raymond Irving Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0015174023906d443404c7a81de6 Subject: =?windows-1252?Q?Re=3A_=5BPHP=2DDEV=5D_PHP_Performance_=2D_1=92000=92000_iterat?= =?windows-1252?Q?ions?= From: kris.craig@gmail.com (Kris Craig) --0015174023906d443404c7a81de6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable It's also worth noting that a billion iterations is a lot in any language, not just PHP. Plus most browsers would probably blow-up in your face if you tried to send that much data. --Kris On Sun, Aug 19, 2012 at 8:41 AM, Raymond Irving wrote: > Many thanks for the feedback. > > __ > Raymond > > On Sun, Aug 19, 2012 at 10:02 AM, Rasmus Lerdorf > wrote: > > > On 08/19/2012 10:29 AM, Raymond Irving wrote: > > > Hello, > > > > > > What could have cause PHP to start out so great but then slows to a > > crawl? > > > Could it be the GC? > > > > > > Number of iterations Node.js PHP > > > --------------------------------------------------------------- > > > 100 2.00 0.14 > > > 10=92000 3.00 10.53 > > > 1=92000=92000 15.00 1119.24 > > > 10=92000=92000 143.00 10621.46 > > > 1=92000=92000=92000 11118.00 1036272.19 > > > > > > See the script here: > > > > > > http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/?= utm_source=3Dfeedburner&utm_medium=3Dfeed&utm_campaign=3DFeed%3A+nettuts+%2= 8Nettuts%2B%29 > > > > > > Is there any way that this can be improved? > > > > If you are doing something that needs to iterate a billion times, you > > shouldn't be using PHP. Things like calculating a fractal is just not > > what PHP was meant for. The vast majority of Web apps have absolutely n= o > > need to iterate that many times. You wouldn't try to show a user a > > billion database records on a single page, for example. Chances are > > pretty good that you are going to iterate less than 1000 times on a > > typical request and if you do end up having to iterate more for some > > reason, you would probably cache the result somewhere so you don't have > > to do it on a subsequent request. > > > > -Rasmus > > > --0015174023906d443404c7a81de6--