Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86934 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24092 invoked from network); 29 Jun 2015 06:31:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jun 2015 06:31:47 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.223.169 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.223.169 mail-ie0-f169.google.com Received: from [209.85.223.169] ([209.85.223.169:36652] helo=mail-ie0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/26-29555-156E0955 for ; Mon, 29 Jun 2015 02:31:45 -0400 Received: by iecvh10 with SMTP id vh10so108803177iec.3 for ; Sun, 28 Jun 2015 23:31:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=App9k0lyFZ5KGoj6XmXmIF1NaCKgucdoslGBWnz1Ksk=; b=W1vy2rN7p1uXcPzaDYmB3YVxEm82BwQq6g25Jp+FvwdhwlWNbO3Xn1dDicdq1md0m7 j1wV096nmwqH9QqRNh80xbw68IT/ZR+ogn1fhDNNXAJ3814eUtp9AtGHVpp1+cPHqgCD HN28sbr5LD/vhu3xiue6M6T9iGZDstM1F1dXM3rCpkcoYZ3ZVnGoaec0MgmvZirb7sDY qsSgTpNmQ9KUTKcim2tAdFcFeHT5zAUUZ9F0iQEP5wUEF/7cjGzo2uMJTWa3w8wZ3LPi tfeB3SLOHUbTtI/KyAmZ1MDidoXMOgOLf6NGX6cUX3zFUU/3a1wrMAOrUJC+RxmghUAD JgeA== X-Gm-Message-State: ALoCoQl8i1YitY7D581SUN56KyAEv2m85aQcIFRI+eFZFo7DppHzGuJAE8/EpdggDgG4MS+O1Dwe6bnFio6+rmU5VizQybYWuxChGzEh7jQtAoWtNUVcGv0WXxZPLET3/Zx4/zChdB9B1Ga1c1R83TkWVXer6DXHRZUOM6fpLTQVk3elGRbclTM= MIME-Version: 1.0 X-Received: by 10.107.17.137 with SMTP id 9mr16918322ior.28.1435559502624; Sun, 28 Jun 2015 23:31:42 -0700 (PDT) Received: by 10.50.241.50 with HTTP; Sun, 28 Jun 2015 23:31:42 -0700 (PDT) In-Reply-To: References: <051CB45EE4B24C7C88C3EABC7E8EE0A2@pc1> Date: Mon, 29 Jun 2015 09:31:42 +0300 Message-ID: To: Matt Wilmas Cc: PHP Internals , Ferenc Kovacs , Yasuo Ohgaki Content-Type: multipart/alternative; boundary=001a113f25dc3557970519a23e1d Subject: Re: [PHP-DEV] Move to Fast ZPP? From: dmitry@zend.com (Dmitry Stogov) --001a113f25dc3557970519a23e1d Content-Type: text/plain; charset=UTF-8 On Sat, Jun 27, 2015 at 12:36 AM, Matt Wilmas wrote: > Hi Dmitry, all, > > ----- Original Message ----- > From: "Dmitry Stogov" > Sent: Thursday, June 25, 2015 > > On Wed, Jun 24, 2015 at 1:35 PM, Matt Wilmas >> wrote: >> >> Hi Dmitry, all, >>> >>> >>> ----- Original Message ----- >>> From: "Dmitry Stogov" >>> Sent: Wednesday, June 24, 2015 >>> >>> We should NOT use it everywhere. It'll lead to code bloat. >>> >>> Thanks. Dmitry. >>> >>> [...] >>> >>> Right, FAST_ZPP makes code larger, inlining stuff in each function, etc. >>> >>> But I was wondering, is there any more that can be done to optimize the >>> slowness of the traditional ZPP? I don't recall any changes being made >>> to >>> it in the last 12-18 months to speed it up at all... >>> >>> Is there a particular part that's making it slow? Is it the *string* of >>> param types? Is it the va_arg's, that doesn't allow the call to be >>> optimized as well and/or the arg fetching that's slow? >>> >>> I know there were the syntax issues as well, but would using something >>> like a single param (array pointer) for param types/values help at all? >>> >>> Or is it just the internals of ZPP that are inherently slow...? :-/ Or >>> that's fine but the "mechanism" of getting there is the issue? >>> >>> >> The traditional ZPP is actually a et another interpreter that reads >> specification string char by char and perform actions. >> And interpreters are usually slower. >> >> I think it may be improved, but I don't expect significant overall >> improvement because of that. >> Now, the cumulative overhead of traditional ZPP on wordpress is ~0.4%. >> Even if we make it 2 times faster, we may get just 0.2% overall speed up. >> > > Yeah, I knew how the traditional ZPP worked, just wondered about any > certain "problem area." :-) But it seems it's just the whole thing, so > much it's doing, besides just the "string format interpretation." > > First, only fractions of a % old ZPP is using on WordPress now? That > doesn't make sense to me... On fast_zpp wiki page, you said last year it > was taking ~6% of time on Wordpress (before FAST_ZPP, of course). And > changing key/hot functions to FAST_ZPP saved ~2.5% time. So that should > have left a few percent of time used by traditional ZPP. > > But everything else has gotten faster since then, so therefore, for an > unchanged old ZPP, its percentage contribution should have gone up? Well, > anyway... > > I went ahead and tried implementing my idea (had been awhile since I > really looked at the FAST_ZPP stuff, and didn't realize it was as simple to > work from). :-) > > It uses the same syntax as "FAST_ZPP" (if we/others like/prefer that) and > a zend_FAST_parse_parameters() function. Code size should be about same as > before, maybe a few more bytes depending on instructions needed (still > thinking/adjusting). > > It seems to have pretty good performance increase! BTW, in quick testing, > I don't see old ZPP using 90% of time even with empty/dummy function. Just > about 50% (with or without ZTS)... > > I didn't know how close we could get to the inlined FAST_ZPP, but it seems > the majority of the way there: ~70% in the simple case. (To be clear, 3x > faster than old.) This was on Windows XP with ancient VC9. > > I don't have a patch ready for you to look at yet, since I didn't finish > changing the macros, etc. > > It would be awesome if this could start being used throughout the > codebase, and not just functions with preferential treatment. :-P Maybe > you'd even switch back from the inlined version in some places, if smaller > code would be better. > Send you implementation as soon as it's ready. I'll test it. Thanks. Dmitry. > > Thanks. Dmitry. >> > > - Matt > --001a113f25dc3557970519a23e1d--