Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84054 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3553 invoked from network); 27 Feb 2015 21:55:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2015 21:55:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=andi@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=andi@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.192.173 as permitted sender) X-PHP-List-Original-Sender: andi@zend.com X-Host-Fingerprint: 209.85.192.173 mail-pd0-f173.google.com Received: from [209.85.192.173] ([209.85.192.173:36144] helo=mail-pd0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/9C-32582-DE7E0F45 for ; Fri, 27 Feb 2015 16:55:57 -0500 Received: by pdbnh10 with SMTP id nh10so365226pdb.3 for ; Fri, 27 Feb 2015 13:55:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=cRd1Xt0WT3sgnDFgcstvgxwCAhMXMgaJE1jBXlQ23hM=; b=D3CYd4i6JhubeafD8gVBEsx5rM/9X4LrBxq8SbK9dzrIDiAJEmPqsQb5LiVrb0Nj6j sewl5ZrQzvCSrdO0/CfYuYgXTkrgJUNQASKxNJYUUfSTPAiYc4TEcOXv+XWQZ/zb3Rgl zbTGc8zxe7aq/yWo/x9QTG+8RjgszZnRb1U8QaQ0UFivdVH3Z2g4c6tqjKwtVlEJ5hV5 /MwBl1a7kKzROPKVbBvEh9pWnzFF4kQTHHoJRd44+V1msv/RZN1CpCbGRYgvIbqsovlr G9KtBy8yMnqKRkGpTtzIhkzvzRVKR2WfqEq49cDnWJ5c6BBX8r1u4papn5XrVie4QZ4U a7ew== X-Gm-Message-State: ALoCoQmLqS0tGGN3VWc8D/TnfAbBwIZM68Buq33qMTt2ZCIe211CK6tAzPRaKijCnDgLvORW2IdQoJlH0dAdCMZ3sOi6TFBQ6cLwoxED6lfWL2ztydfVNImI39dZYiVW8hlnxAFZphhyRdzcF+ytamSZSncHpDQjdg== X-Received: by 10.70.140.162 with SMTP id rh2mr27456865pdb.131.1425074154224; Fri, 27 Feb 2015 13:55:54 -0800 (PST) Received: from ?IPv6:2602:301:779f:53c0:f93d:731a:bf69:9e9? ([2602:301:779f:53c0:f93d:731a:bf69:9e9]) by mx.google.com with ESMTPSA id fm3sm4922627pab.29.2015.02.27.13.55.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Feb 2015 13:55:53 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Fri, 27 Feb 2015 13:55:51 -0800 Cc: Dmitry Stogov , Zeev Suraski , Jordi Boggiano , PHP Internals X-Mao-Original-Outgoing-Id: 446766951.241133-794e11821817f9f02516ea31d49acb47 Content-Transfer-Encoding: quoted-printable Message-ID: <56FAF35D-717D-4A88-9A2B-35B0F87BBDE8@zend.com> References: <54F08FF3.3040404@seld.be> <63262a9c0edd51bbf38df2a00c87340e@mail.gmail.com> To: Anthony Ferrara X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] Zend JIT Open Sourced From: andi@zend.com (Andi Gutmans) > On Feb 27, 2015, at 11:36 AM, Anthony Ferrara = wrote: >=20 > Dmitry, >=20 >>> That's not to say there's anything wrong with this approach, nor = that >>> there isn't a ton we can learn from it. I think it's a fantastic >>> research effort and plan on digging through it myself. Thank you for >>> open sourcing it. >>=20 >>=20 >> Thanks for good words :) >>=20 >> This work may be adopted for some specific cases. >> 25-30 times speedup on Mandelbrot allows usage for numeric = calculation >> instead of C. >>=20 >> https://gist.github.com/dstogov/12323ad13d3240aee8f1 >>=20 >> anyone may repeat the language battle :) >=20 > These tests seem really odd. A 15% speed advantage over GCC -O2? Sure, > it's possible. But I don't think it's likely. It really smells to me > like bias in the testing methodology. (and the lack of an -O3 result > is suspicious as well). >=20 > And looking at the code, I can see why. The PHP version is writing to > an internal buffer, while every other version has to write to STDOUT > on every single iteration. >=20 > So you are intentionally not benchmarking the output in the PHP > version (you even explicitly call ob_start()) but are benchmarking it > in every other version. So in fact, the PHP code does something > different than the rest of the code. We actually discussed this at the time of the results. IIRC it really has nothing to do with the output mechanism, etc.. The = benchmark does enough iterations and very little output that the impact = there is negligible (you can test this yourself to see if I am right but = I am pretty sure I am). It is due to the fact that at runtime LLVM can optimize better to the = architecture than a static standard gcc build. Constraining gcc with the = right architecture dependent switches upfront will also improve the gcc = results. Anyway, still pretty cool to see this although it has very = little impact (if any) on real world apps ala Magent, WordPress, Drupal, = ... I think the important learning is that faster synthetic benchmarks have = very little impact on overall application performance. Sure it can have = an impact on specific algorithmic pieces of code but that=E2=80=99s the = exception not the norm. No doubt there are other ways to write JIT = including tracing JITs etc. but I do think we found that we are more = bound by I/O and memory/caches than the quality of the machine code as = the engine is already quite tight. And with apps consuming more and more = Cloud services the I/O bottleneck issue looks grimmer than ever! :) That = also comes across consistently in benchmarks of PHP 7 vs. hhvm on = real-world apps - you see a JIT and non-JIT platform pretty much head to = head on performance and actually on the complex stuff PHP 7 is often = faster. Anyway, definitely makes sense to continue to look at these kind of = opportunities down the road but PHP 7 is such a huge step-up on real = world application performance I think getting that out the door is the = biggest possible short-term win when it comes to performance. Looking = forward to seeing folks dig into the code and have ideas down the road!! Andi