Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89462 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14197 invoked from network); 27 Nov 2015 10:02:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2015 10:02:36 -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:11907] helo=smtp3-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/C5-04444-93A28565 for ; Fri, 27 Nov 2015 05:02:35 -0500 Received: from daffy (unknown [82.242.106.155]) by smtp3-g21.free.fr (Postfix) with ESMTP id 47AD3A6250 for ; Fri, 27 Nov 2015 11:02:02 +0100 (CET) To: Date: Fri, 27 Nov 2015 11:02:31 +0100 Message-ID: <009301d128fa$bb2675d0$31736170$@lool.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0094_01D12903.1CED00B0" X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdEo+GWQxDvFpI+BRxi8GE6RvYcMxw== Content-Language: fr Importance: High Subject: Proof of Concept : 3.5x and more Performance Boost for php7 using 4 cores From: php-mailing-list@lool.fr ("Pascal KISSIAN") ------=_NextPart_000_0094_01D12903.1CED00B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi everybody, I made a simple test to know if it was possible to speed-up php performance by using parallel programming. I modified 2 functions within ./ext/standard/array.c file of PHP-7.0.0RC7 to use openmp and added the -fopenmp flag to the compiler flags in the Makefile. I modified the php functions array_sum() and in_array() to do some benchmarking. I made changes in the php_search_array() function only using the strict comparaison. To make it work in all cases, you have just to do some cut'n'paste, but the source is easier to read with only 1 change. Use : OMP_NUM_THREADS=xx /path_to/php test_file.php to specify xx, the number of threads to use in your test file I got an average speed-up of 3.5 using 4 cores. You can find all details: . Test files . Modified source files . Benchmarks . Faq . . At http://poc.yakpro.com/?php7_performance_boost_parallel_computing My main goal is to initiate a global thinking, among php core developers, concerning the parallel computing and php, at each level: - Core level: For speeding-up functions, but also the interpreter (by parallelizing opcodes pre-fetching for example) - User level: imagine and implement simple and efficient primitives to make the php developer comfortable with parallel programming. A multicore php8 or php9? Wouldn't be cool???? Best regards, Pascal KISSIAN ------=_NextPart_000_0094_01D12903.1CED00B0--