Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86917 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76791 invoked from network); 26 Jun 2015 21:36:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2015 21:36:35 -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 216.33.127.80 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 216.33.127.80 mta11.charter.net Solaris 10 1203 Received: from [216.33.127.80] ([216.33.127.80:42193] helo=mta11.charter.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/20-10002-2E5CD855 for ; Fri, 26 Jun 2015 17:36:34 -0400 Received: from imp09 ([10.20.200.9]) by mta11.charter.net (InterMail vM.8.01.05.09 201-2260-151-124-20120717) with ESMTP id <20150626213631.TKYX5815.mta11.charter.net@imp09>; Fri, 26 Jun 2015 17:36:31 -0400 Received: from mtaout003.msg.strl.va.charter.net ([68.114.190.28]) by imp09 with smtp.charter.net id l9cX1q0010dCcRg059cXwa; Fri, 26 Jun 2015 17:36:31 -0400 Received: from impout002 ([68.114.189.17]) by mtaout003.msg.strl.va.charter.net (InterMail vM.9.00.018.00 201-2473-151) with ESMTP id <20150626213631.ZOKW30688.mtaout003.msg.strl.va.charter.net@impout002>; Fri, 26 Jun 2015 16:36:31 -0500 Received: from pc1 ([96.35.251.86]) by impout002 with charter.net id l9cW1q0091sc0so019cWXH; Fri, 26 Jun 2015 16:36:31 -0500 X-Authority-Analysis: v=2.1 cv=Lrgcyxtc c=1 sm=1 tr=0 a=Is5gsZaFXO8aPum+t7Tz+g==:117 a=Is5gsZaFXO8aPum+t7Tz+g==:17 a=hOpmn2quAAAA:8 a=t0KHGDoOaRkA:10 a=BCPeO_TGAAAA:8 a=N659UExz7-8A:10 a=8rjsljUSalaJR4FWeJcA:9 a=pILNOxqGKmIA:10 Message-ID: To: "Dmitry Stogov" Cc: "PHP Internals" , "Ferenc Kovacs" , "Yasuo Ohgaki" References: <051CB45EE4B24C7C88C3EABC7E8EE0A2@pc1> Date: Fri, 26 Jun 2015 16:36:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Subject: Re: [PHP-DEV] Move to Fast ZPP? From: php_lists@realplain.com ("Matt Wilmas") 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. > Thanks. Dmitry. - Matt