Some open-source projects made by Frank DENIS.

PHPBench

PHP benchmark suite

PHPBench is a benchmark suite for PHP. It performs a large number of simple tests in order to bench various aspects of the PHP interpreter. PHPBench can be used to compare hardware, operating systems, PHP versions, PHP accelerators and caches, compiler options, etc. Custom tests can be easily added to the suite.

Advanced usage

More iterations.

In order to get accurate results, every test is evaluated more than once.

By defaut, tests are evaluated 100000 times, or multiples of that value for some tests that are known to be CPU-expensive or other tests that are known to be very fast.

If you have slow hardware or very fast hardware, you can change the number of iterations, with the -i switch:

./phpbench.php -i 5000

The ‘score’ you get when the benchmark completes is a ratio between the number of iterations and the total time that was needed to perform all tests. Thus, the score should be independant of the number of iterations, but the higher number you use, the more accuracy you will get.

CSV output.

You can save a CSV summary of the benchmark. This summary contains the time needed to perform every test, and a percentile value. A value of 12% would mean that 12% of the total time was needed for that particular test.

The summary can be loaded in almost any spreadsheet, including, but not limited to: Kspread (Koffice), OOcalc (Openoffice), Gnumeric and Excel.

In order to produce that CSV file, just use the -f option, followed by the name of the file you are willing to create:

./phpbench.php -f summary.csv