Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89464 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24713 invoked from network); 27 Nov 2015 13:41:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2015 13:41:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:51716] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/D6-04444-79D58565 for ; Fri, 27 Nov 2015 08:41:44 -0500 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 44D494F95B; Fri, 27 Nov 2015 14:41:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-93-104-4-196.dynamic.mnet-online.de [93.104.4.196]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 91AAA4F95B; Fri, 27 Nov 2015 14:41:45 +0100 (CET) Message-ID: <1448631693.24066.10.camel@kuechenschabe> To: Pascal KISSIAN Cc: internals@lists.php.net Date: Fri, 27 Nov 2015 14:41:33 +0100 In-Reply-To: <009301d128fa$bb2675d0$31736170$@lool.fr> References: <009301d128fa$bb2675d0$31736170$@lool.fr> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proof of Concept : 3.5x and more Performance Boost for php7 using 4 cores From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Fri, 2015-11-27 at 11:02 +0100, Pascal KISSIAN wrote: > > I made a simple test to know if it was possible to speed-up php > performance > by using parallel programming. [...] > Use : > > OMP_NUM_THREADS=xx /path_to/php test_file.php 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. 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) So please run tests with a "typical" application (like wordpress or such) in a more typical environment. johannes