Console tools for benchmark PHP algorithms.
- PHP CLI 5.4+
git clone https://github.com/nafigator/php-bench.git
cd php-bench
git submodule update --init
Create copy of test executable and modify your local settings:
cp test-example test
Show available tests:
./test-list
Create test skeleton:
./test-new <Test name> [<Block count>]
Test name - name of new test class.
Block count - how much test blocks generate
Run test:
./test <Class>
Class - class name from Tests directory.
./test CloneVsNew
./test IncludeVsRequire
for name in $(find Tests -type f -name '*.php' | sed 's/^Tests\/\(.*\)\.php/\1/');
do echo;echo $name;echo; ./test $name;
done;
If you'd like to see other PHP-algorithm comparison in this collection, feel free to create a new issue. Thanks!