Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58783 invoked from network); 27 Feb 2015 19:57:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Feb 2015 19:57:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.182 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.182 mail-vc0-f182.google.com Received: from [209.85.220.182] ([209.85.220.182:47590] helo=mail-vc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/63-32582-C1CC0F45 for ; Fri, 27 Feb 2015 14:57:17 -0500 Received: by mail-vc0-f182.google.com with SMTP id id10so7119293vcb.13 for ; Fri, 27 Feb 2015 11:57:13 -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=rZYlNiLmX0DA6TFNjhMci04yDY/waKZOnotCz7myWg0=; b=PaU8rjcC5UU0wPLAI38j0mWZf8ipMAN/TUptX5mj/jdP1GKc5Kz1HpwdBxlsWAVfA4 l8cIh+e7+ZGXWj83l3F/DIzuJiv44w4DnLETgxFQlNprAVtAKCz974U5q2quk2MWpNRp pmi4gfZy/HVgBZGrq/kQHThrH6R68xFqVqVjiM5qa77fNHRf9sOrlpSqgvMbo7KtUAap bNpGL1EqHRqfAs8poTKYu9bDOLeSOAOXzpF94iuBZKcbSsBXo6YrnzCZCfrTEwIU2AYM 8AjRYDMGYuNlV0vH/Gwj2hAO+Z8OunrmvN+Qd/sg/PNWI1CiNDAg8kZGw1boRu1vCGac MwdA== X-Gm-Message-State: ALoCoQmKgnSSwtWwgFqVyivVd7eV7ELV1IvaT76PdnNTPp0FbMbl6jnSvnnGfpjoxqucR+BfYdIx8ipI//u9Z2X95k4eZ4v79UyJ2ckfwX5ltlLPF8tmZaG0znZBocCMDO+V1NU4CDgWLxTQa5qTOTSEoqYlOAFBDQ== MIME-Version: 1.0 X-Received: by 10.52.52.136 with SMTP id t8mr14324085vdo.49.1425067033675; Fri, 27 Feb 2015 11:57:13 -0800 (PST) Received: by 10.52.113.231 with HTTP; Fri, 27 Feb 2015 11:57:13 -0800 (PST) In-Reply-To: References: <54F08FF3.3040404@seld.be> <63262a9c0edd51bbf38df2a00c87340e@mail.gmail.com> Date: Fri, 27 Feb 2015 23:57:13 +0400 Message-ID: To: Anthony Ferrara Cc: Zeev Suraski , Jordi Boggiano , PHP Internals Content-Type: multipart/alternative; boundary=089e0115f04852dbb4051017460b Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced From: dmitry@zend.com (Dmitry Stogov) --089e0115f04852dbb4051017460b Content-Type: text/plain; charset=UTF-8 On Fri, Feb 27, 2015 at 10:36 PM, 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). > No. it true, but of course it's not 100% fair. gcc compiles files for x86 or x86_64 platform in general. When we compile in run-time we may relay on knowledge of our CPU. In this case LLVM generates AVX instructions, while gcc SSE2. Looking into assembler code, you may see that PHP even not inferred type of all variables and makes few unnecessary check in the loop, but modern CPU are so smart that the code looking mach worse work with the same speed as (gcc -O2). Unfortunately it works in the other direction as well. gcc -O2 -mavx will outperform us :) > > 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. > > Sneaky sneaky. Also completely fake. A proper methodology would have > explicitly disabled any buffer so that the tests all tested the same > thing. Or even better, build up an internal buffer in all of the > implementations. That way you can compare the computation and not rely > on STDOUT (terminal) response. > this also may make some difference, but I think PHP stream layer is not as good as C. just profile it with Linux perf, oprofile, callgrind, ... perf record perf report -n Thanks. Dmitry > > Anthony > --089e0115f04852dbb4051017460b--