Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36055 invoked from network); 20 Jun 2013 14:47:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2013 14:47:59 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 209.85.220.173 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.173 mail-vc0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:45475] helo=mail-vc0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/96-25301-C1613C15 for ; Thu, 20 Jun 2013 10:47:58 -0400 Received: by mail-vc0-f173.google.com with SMTP id ht10so4827734vcb.18 for ; Thu, 20 Jun 2013 07:47:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=X2pPvUEk/0uN958lf/U9kXqjeBUE+1PytEid96WMaWA=; b=jM9qFuifcdTt2o14r2QlccOvF9aA6/NawW5y8z/zthOgV7PvnLc/8975Oi/qjpVXnL 3FtLT1ie/uAX4cGDG4IskrexcCUwpgk8Jzw/kaOxlTwgSEsGRpXO9weoybNAA3sjJgvU ou8KnQt1YYjMHTxSHVH8FsK0CMYD8sVzJw7HNYc/jO83VE5B8iCscHkO5SjVWHzg7ItJ jKHp6Z+TdrAvT3Cm64OdARgvPePR11Br3+xSZsJAA/B+reTWuc7IKd1z3sJGqFrleQNt aRtGHggqULSST6bp7GoXfOTYh4Wk0W2v/U/JTddB842e77UDLdwihinnOXcUpKCqz4im WNvQ== MIME-Version: 1.0 X-Received: by 10.52.91.202 with SMTP id cg10mr2699430vdb.85.1371739673965; Thu, 20 Jun 2013 07:47:53 -0700 (PDT) Received: by 10.52.73.67 with HTTP; Thu, 20 Jun 2013 07:47:53 -0700 (PDT) In-Reply-To: <51C309CE.7080009@linaro.org> References: <51C309CE.7080009@linaro.org> Date: Thu, 20 Jun 2013 18:47:53 +0400 Message-ID: To: Ard Biesheuvel Cc: PHP Internals , Rasmus Lerdorf , pollita@php.net Content-Type: multipart/alternative; boundary=bcaec5015cf7fdc68404df970704 X-Gm-Message-State: ALoCoQk5BhZ7Nq9JLwQAD1DWEmTEuhYCTLCgA3Le8VqExt/lkgNhvyPA8NfG6gDtbPW+rgmCahT4rnCC12Ge+DwCj5apASswdGhs0MfNFBpuKIaFbdInDmcVkCYx085kZPe3o82FZbru Subject: Re: [PHP-DEV] ARM performance and GOTO executor From: dmitry@zend.com (Dmitry Stogov) --bcaec5015cf7fdc68404df970704 Content-Type: text/plain; charset=UTF-8 GOTO-executor is faster on x86 as well. It may be proven by synthetic benchmarks, however. on real-life applications it doesn't make any significant difference (sometimes it even slowdown). I'm not sure how we should generate (and test) zend_vm_execute-goto.h. Probably the only good option is generating all the different executors at once and may be even linking them all together to select one at run-time. FREE_OP2() in BRK/CONT my be removed. Thanks. Dmitry. On Thu, Jun 20, 2013 at 5:55 PM, Ard Biesheuvel wrote: > Hello all, > > I am working on ARM server performance tuning, and I have been playing > around a bit with the various executor modes and zend_vm_gen.php. > > As it turns out (scroll down for numbers), the GOTO executor is much > faster than the default CALL executor on ARM, partly due to fewer branch > mispredictions (as perf tells me) but there are probably other factors at > play here as well. > > My question to you is if we could parametrize this in the build system, > for instance by adding alternate files zend_vm_opcodes-goto.h and > zend_vm_execute-goto.h to the tree, and selecting those when targeting ARM > (and perhaps other archs that may prefer GOTO over CALL as well). Or is > there a better way of including/selecting alternate executors? > > Also, when playing around, I noticed that building the executor without > specialization is broken, as there are erroneous FREE_OP2() calls left > behind in the handlers for 'break' and 'continue'. If nobody objects, I > will remove them (zend_vm_def.h lines 3302 and 3314) > > Regards, > Ard. > > > ARM Cortex-A15 @ 1.7 GHz with default executor (specialized CALL) > ==============================**==============================**===== > > simple 0.358 > simplecall 0.396 > simpleucall 0.419 > simpleudcall 0.458 > mandel 0.839 > mandel2 1.038 > ackermann(7) 0.400 > ary(50000) 0.096 > ary2(50000) 0.087 > ary3(2000) 0.490 > fibo(30) 1.157 > hash1(50000) 0.135 > hash2(500) 0.096 > heapsort(20000) 0.266 > matrix(20) 0.309 > nestedloop(12) 0.499 > sieve(30) 0.363 > strcat(200000) 0.046 > ------------------------ > Total 7.449 > > Performance counter stats for 'php Zend/bench.php': > > 7444.535230 task-clock # 0.983 CPUs utilized > 103 context-switches # 0.014 K/sec > 9 cpu-migrations # 0.001 K/sec > 5963 page-faults # 0.801 K/sec > 12728701964 cycles # 1.710 GHz > 13603248229 instructions # 1.07 insns per cycle > 2633774500 branches # 353.786 M/sec > 118799433 branch-misses # 4.51% of all branches > > 7.570311211 seconds time elapsed > > > ARM Cortex-A15 @ 1.7 GHz with specialized GOTO executor > ==============================**========================= > > simple 0.185 > simplecall 0.295 > simpleucall 0.249 > simpleudcall 0.257 > mandel 0.349 > mandel2 0.529 > ackermann(7) 0.252 > ary(50000) 0.061 > ary2(50000) 0.060 > ary3(2000) 0.393 > fibo(30) 0.798 > hash1(50000) 0.092 > hash2(500) 0.079 > heapsort(20000) 0.195 > matrix(20) 0.206 > nestedloop(12) 0.214 > sieve(30) 0.241 > strcat(200000) 0.025 > ------------------------ > Total 4.479 > > Performance counter stats for '~/php Zend/bench.php': > > 4468.040559 task-clock # 0.983 CPUs utilized > 79 context-switches # 0.018 K/sec > 9 cpu-migrations # 0.002 K/sec > 5062 page-faults # 0.001 M/sec > 7561345552 cycles # 1.692 GHz > 11297962039 instructions # 1.49 insns per cycle > 2121936756 branches # 474.914 M/sec > 22190686 branch-misses # 1.05% of all branches > > 4.545350085 seconds time elapsed > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec5015cf7fdc68404df970704--