Proof of Concept : 3.5x and more Performance Boost for php7 using 4 cores
| From: | Pascal KISSIAN | Date: | Fri, 27 Nov 2015 10:02:31 +0000 |
| Subject: | Proof of Concept : 3.5x and more Performance Boost for php7 using 4 cores | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-89462@lists.php.net to get a copy of this message | ||
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