Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62261 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86768 invoked from network); 19 Aug 2012 15:41:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2012 15:41:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=xwisdom@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=xwisdom@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: xwisdom@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:33458] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/92-03087-73901305 for ; Sun, 19 Aug 2012 11:41:44 -0400 Received: by lbbgp3 with SMTP id gp3so3016579lbb.29 for ; Sun, 19 Aug 2012 08:41:40 -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 :content-type; bh=dZZdR1/j0rFx1e/fh14VsihW1IA+XGtYC1uRNVmzltc=; b=dK7E0ANT8Y+GfmtH5Ep9ZmyIsOStsbJqTGZFjj6TEmM0nh4v2EtQYQ5s9vktb+c80a PYY/KDKrWI3fw5T4fjI2Ab9RZ9HVgHhIh6LrgUlthyHeTQeYb+PnZ/AQoNJimu4KYMb/ kaQxTW42fbrIRZUY7aHSNNCUHzM/WbmDfP//+xEJYiRSkLyh/DWReEclMRmZmIVmiD97 DAf/Y9T2fx4Gd8iQ11/KUhUEWOgDpYJfe4zcFidcPyzD20+IKmbGFRnw3e1/nx/IHxar R4pkXx2X+4V+JXWhrbGinVNYEcYiR1AVesy65vuDrYV0je4EKq2vg1SoszqMAcG9ijHU yHLQ== MIME-Version: 1.0 Received: by 10.152.129.104 with SMTP id nv8mr1086672lab.32.1345390899976; Sun, 19 Aug 2012 08:41:39 -0700 (PDT) Received: by 10.112.145.70 with HTTP; Sun, 19 Aug 2012 08:41:39 -0700 (PDT) In-Reply-To: <5030FFF2.1070507@lerdorf.com> References: <5030FFF2.1070507@lerdorf.com> Date: Sun, 19 Aug 2012 10:41:39 -0500 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d042d05b4ad5b4104c7a03a66 Subject: =?windows-1252?Q?Re=3A_=5BPHP=2DDEV=5D_PHP_Performance_=2D_1=92000=92000_iterat?= =?windows-1252?Q?ions?= From: xwisdom@gmail.com (Raymond Irving) --f46d042d05b4ad5b4104c7a03a66 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 no > 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 > --f46d042d05b4ad5b4104c7a03a66--