Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84078 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4201 invoked from network); 28 Feb 2015 14:24:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2015 14:24:00 -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.220.178 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.178 mail-vc0-f178.google.com Received: from [209.85.220.178] ([209.85.220.178:36311] helo=mail-vc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/20-30773-E7FC1F45 for ; Sat, 28 Feb 2015 09:23:59 -0500 Received: by mail-vc0-f178.google.com with SMTP id hq11so8177691vcb.9 for ; Sat, 28 Feb 2015 06:23:56 -0800 (PST) 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=+OoFiQ7qyqSM7Tn+t2pq/RkjLJ5k3SBJwGKAaSmRF4g=; b=d//sIdoYvWbw2t4sUGcaO8Abe5If1BwwIcRsf+Z16JSh6yXu1mWc0Ww7dDhQVsxqjQ UZvexo39PostZHJQ2x06SndkFEcakCYIpMd+jADLsWAiUIMAt6rQrXac3WV8/wjUm5hR cATZO+loOxAB6Nzf9zOXrBFTjb4QMTD+BFTvIKunIS6tCiUlRkJfKz5fgAxL9JTbJiHm Yc7Cvy0ZxTwEUy1Q4+9W6HMJa83mzWddb9YbbLqSmj/+/p8SEyl3Spnk7RQxj3XBrwFh ynIgO+I2nCwHdK+W/eCnHLgZdmiRFuf8QPGISC0btj/a/Em3U9u49rq56+wEYBvVqUUe qrCA== X-Gm-Message-State: ALoCoQlDMKakKUvXhgRQWlwexdahbABQUatsrdbudRgZz56SuWEjD/4LWjWOJ6pPHcGBz6Auj025A688QfwBExEKA376GoOsWvtfdnMFVfBaLKwaI7BbWUpFkU9P4Ghta0EUdlLrEysbt6gUlF9GLaMsOm/ul3sTZw== MIME-Version: 1.0 X-Received: by 10.53.11.76 with SMTP id eg12mr17659233vdd.68.1425133436353; Sat, 28 Feb 2015 06:23:56 -0800 (PST) Received: by 10.52.113.231 with HTTP; Sat, 28 Feb 2015 06:23:56 -0800 (PST) In-Reply-To: <56FAF35D-717D-4A88-9A2B-35B0F87BBDE8@zend.com> References: <54F08FF3.3040404@seld.be> <63262a9c0edd51bbf38df2a00c87340e@mail.gmail.com> <56FAF35D-717D-4A88-9A2B-35B0F87BBDE8@zend.com> Date: Sat, 28 Feb 2015 18:23:56 +0400 Message-ID: To: Andi Gutmans Cc: Anthony Ferrara , Zeev Suraski , Jordi Boggiano , PHP Internals Content-Type: multipart/alternative; boundary=001a1133f0563b5a92051026bc42 Subject: Re: [PHP-DEV] Zend JIT Open Sourced From: dmitry@zend.com (Dmitry Stogov) --001a1133f0563b5a92051026bc42 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Feb 28, 2015 at 12:55 AM, Andi Gutmans wrote: > > On Feb 27, 2015, at 11:36 AM, Anthony Ferrara > wrote: > > > > Dmitry, > > > >>> 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. > >> > >> > >> Thanks for good words :) > >> > >> This work may be adopted for some specific cases. > >> 25-30 times speedup on Mandelbrot allows usage for numeric calculation > >> instead of C. > >> > >> https://gist.github.com/dstogov/12323ad13d3240aee8f1 > >> > >> anyone may repeat the language battle :) > > > > 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). > > > > 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. > > > > 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 littl= e > 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 a= n > impact on specific algorithmic pieces of code but that=E2=80=99s the exce= ption not > the norm. No doubt there are other ways to write JIT including tracing JI= Ts > 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 alrea= dy > 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 worl= d > 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!! > Completely agree. And have to say that these experiments with JIT leaded us to understanding of real PHP-5 bottleneck, that allowed us to make about 60% improvement on real-life in PHPNG and already near 2 times in PHP7. But LuaJIT without JIT is 4 times faster on Mandelbrot. It's a challenge... Thanks. Dmitry. > > Andi > > --001a1133f0563b5a92051026bc42--