Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89466 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29685 invoked from network); 27 Nov 2015 14:27:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2015 14:27:45 -0000 Authentication-Results: pb1.pair.com header.from=php-mailing-list@lool.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php-mailing-list@lool.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lool.fr from 212.27.42.3 cause and error) X-PHP-List-Original-Sender: php-mailing-list@lool.fr X-Host-Fingerprint: 212.27.42.3 smtp3-g21.free.fr Received: from [212.27.42.3] ([212.27.42.3:30250] helo=smtp3-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/B7-04444-06868565 for ; Fri, 27 Nov 2015 09:27:45 -0500 Received: from daffy (unknown [82.242.106.155]) by smtp3-g21.free.fr (Postfix) with ESMTP id 11D3CA61F3; Fri, 27 Nov 2015 15:27:12 +0100 (CET) To: =?UTF-8?Q?'Johannes_Schl=C3=BCter'?= Cc: References: <009301d128fa$bb2675d0$31736170$@lool.fr> <1448631693.24066.10.camel@kuechenschabe> In-Reply-To: <1448631693.24066.10.camel@kuechenschabe> Date: Fri, 27 Nov 2015 15:27:41 +0100 Message-ID: <00b501d1291f$c66ca930$5345fb90$@lool.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQNAx7Lc+3hQqsfh+JQhDAFvMI653QEybZIKm8cUFtA= Content-Language: fr Importance: High Subject: RE: [PHP-DEV] Proof of Concept : 3.5x and more Performance Boost for php7 using 4 cores From: php-mailing-list@lool.fr ("Pascal KISSIAN") Hi Johannes, thanks for the answer, -----Message d'origine----- De : Johannes Schl=C3=BCter [mailto:johannes@schlueters.de]=20 Envoy=C3=A9 : vendredi 27 novembre 2015 14:42 =C3=80 : Pascal KISSIAN Cc : internals@lists.php.net Objet : Re: [PHP-DEV] Proof of Concept : 3.5x and more Performance Boost = for php7 using 4 cores >Your test runs a single PHP process. Mind that in a typical deployment = on a server you have quite a few parallel PHP processes already = competing for time on the CPU (when not >waiting for IO) a benchmark = should reflect that. You can see at = http://poc.yakpro.com/?php7_performance_boost_parallel_computing , in the " Faq: Is it usefull on a heavy traffic web site? " section, a = graph that answers partially your question. >For in_array I'm assuming that often either one or no match exist, thus = in average the old algorithm has to process half the elements in = average. With that form of parallelization it >will process C/(N -1) + = C/2N elements where C is the count of elements and N the number of = cores, so in total need more CPU. (might be wrong) In the new algorithm, each core processes C/2N elements in parallel, = and when one core has found a result, the process is stopped for the = other cores... so the average cpu need is C/2N * N so exactly the same C/2. >So please run tests with a "typical" application (like wordpress or >such) in a more typical environment. Do you know a real application that is executing only array_sum() or = in_array() functions? If the time of those functions represent only 0.5% of global run time, = we will just speed-up those 0.5%.... I have not rewritten all php in parallel... I just did a "Proof of Concept", to be sure that it is possible to run = some php functions in parallel, and this in less time. And I hope that many people will be interested to start thinking = parallel in php, as the next speed improvements in hardware will be the = multiplication of cores in a cpu.