This project benchmarks the most popular & feature rich PHP serializers. It measures the time consumed during the serialization of an object graph and give you a report of the execution.
The result of the benchmark is directly available on travis: https://travis-ci.org/egeloen/ivory-serializer-benchmark
If you're interesting to use the project locally, follow the next steps.
First clone the project on on your system:
$ git clone [email protected]:egeloen/ivory-serializer-benchmark.git
The most easy way to set up the project is to install Docker and Docker Composer and build the project. The configuration is shipped with a distribution environment file allowing you to customize your current user/group ID:
$ cp .env.dist .env
The most important part is the USER_ID
and GROUP_ID
which should match your current user/group.
Once you have configured your environment, you can build the project:
$ docker-compose build
Install the dependencies via Composer:
$ docker-compose run --rm php composer install
To benchmark a single serialization, you can use:
$ docker-compose run --rm php bin/benchmark
If you want to get a more accurate value, you can use the iteration
option which will run the benchmark n
times
and will give you the average of the executions:
$ docker-compose run --rm php bin/benchmark --iteration 100
If you want to increase the horizontal complexity of the serialization, you can use the horizontal-complexity
option
which represents a complexity factor:
$ docker-compose run --rm php bin/benchmark --horizontal-complexity 4
If you want to increase the vertical complexity of the serialization, you can use the vertical-complexity
option
which represents a complexity factor:
$ docker-compose run --rm php bin/benchmark --vertical-complexity 4
We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR!.
The Ivory Serializer is under the MIT license. For the full copyright and license information, please read the LICENSE file that was distributed with this source code.