Git Product home page Git Product logo

ivory-serializer-benchmark's Introduction

README

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/php-serializers/ivory-serializer-benchmark

This repository is a fork of egeloen/ivory-serializer-benchmark, the project was looking not maintained for a while, please refer to this as the next reference point when benchmarking PHP serializers.

Documentation

If you're interesting to use the project locally, follow the next steps.

Set up the project

The easiest 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 dependencies

Install the dependencies via Composer:

$ docker-compose run --rm php composer install

Benchmark

We use PHPBench internally, with sane defaults setup for benchmarking the serializers.

To benchmark serialization, you can use:

$ docker-compose run --rm php ./vendor/bin/phpbench run --report=bench

By default, the benchmark runs 5 Revolutions and 5 Iterations. You can override either with the iterations and revs options.

$ docker-compose run --rm php ./vendor/bin/phpbench run --report=bench --iterations=10 --revs=10

By default, the benchmark runs different configurations of horizontal and vertical complexity. If you wish to specify your own, you can use the parameters option which is an array of two integers, the first representing the horizontal and the second representing the vertical complexity.

$ docker-compose run --rm php ./vendor/bin/phpbench run --report=bench --parameters='[1,2]'

If you want to run the benchmark only for a specific or subset of serializers, you can use the filter option:

$ docker-compose run --rm php ./vendor/bin/phpbench run --report=bench --filter=Symfony

Available serializers

You can see a list of the serializer available and its current version by running the following command:

$ docker-compose run --rm php ./vendor/bin/phpbench info

Available implementations:

  • BetterSerializer
  • Ivory
  • JaneAutomapper
  • Jms
  • JmsMinimal
  • JsonSerializable
  • SerializardClosure
  • SerializardReflection
  • SymfonyGetSetNormalizer
  • SymfonyObjectNormalizer
  • TSantos
  • Gson

Contribute

We love contributors! PhpSerializers is an open source project. If you'd like to contribute, feel free to propose a PR!.

License

The Php Serializers Benchmark is under the MIT license. For the full copyright and license information, please read the LICENSE file that was distributed with this source code.

ivory-serializer-benchmark's People

Contributors

bendavies avatar dunglas avatar fbourigault avatar gelolabs avatar goetas avatar joelwurtz avatar pborreli avatar rastusik avatar thunderer avatar tsantos84 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.