Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37513 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53567 invoked from network); 7 May 2008 14:50:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2008 14:50:58 -0000 Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.151.69.1 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.151.69.1 liberty.vosn.net Linux 2.4/2.6 Received: from [209.151.69.1] ([209.151.69.1:55767] helo=liberty.vosn.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/3B-20715-1D1C1284 for ; Wed, 07 May 2008 10:50:58 -0400 Received: from 69-29-135-154.dyn.centurytel.net ([69.29.135.154]:61443 helo=pc1) by liberty.vosn.net with smtp (Exim 4.68) (envelope-from ) id 1Jtkys-0007Nc-0s; Wed, 07 May 2008 08:50:54 -0600 Message-ID: <016801c8b051$c02db680$0201a8c0@pc1> To: , "Felipe Pena" References: <013a01c8aec5$b189d650$0201a8c0@pc1> <481F8BCD.30207@lerdorf.com> <1210034790.5744.5.camel@pena> <01e801c8af82$3ed8bd20$0201a8c0@pc1> <1210103098.5344.17.camel@felipe> Date: Wed, 7 May 2008 09:50:51 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - liberty.vosn.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - realplain.com Subject: Re: [PHP-DEV] [PATCH] Some string changes/optimizations From: php_lists@realplain.com ("Matt Wilmas") Hi Felipe, I don't know. :-/ That's a pretty big discrepancy... (Did you do a complete recompile before and after the patch?) With your test, timed with microtime() on my old Win2k system (release/non-debug), I get 1.56s before and 1.54s after -- about what I'd expect after doing my own random testing previously. It's not expected to be a big optimization, just eliminate the overhead of the old INIT_STRING only allocating an empty string initially. (Of course, the more ADD_STRING/ADD_VAR ops for a string, the less relative difference there is.) And saving an opcode makes creating/destroying op arrays just a bit faster without a cache. BTW, after recompiling the latest 5.3 code, after some changes in the last days (mine had been a few days old), I observed a couple different things after my changes: the binary size was 8K smaller (no change a few days ago), and there was a surprising improvement on a lot of the bench.php tests (I think "ackermann" is the only one that uses interpolated strings). Just compiler randomness I guess, but going from 27.9s to 27.1s is more than the fluctuation I've seen before. :-) - Matt ----- Original Message ----- From: "Felipe Pena" Sent: Tuesday, May 06, 2008 > Hi Matt, > about optimization..., do you have any test for comparison? Why, in my > crazy test (http://rafb.net/p/ZzQQQP97.html), the actual code is more > faster than your patch. > > real 0m1.156s > vs > real 0m1.368s > > (using time command) > > > I'm just curious, i'm not against your patch. > > Thanks. > -- > Regards, > Felipe Pena.