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



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to