Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Serializer support + disabled Symfony serializer #7

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .env

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.env
.env
/cache
/vendor
.idea
/*.xml
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- hhvm

branches:
only: master

install:
- if [[ $TRAVIS_PHP_VERSION = 5.6 ]]; then printf "\n" | pecl install apcu-4.0.11; fi
- if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then printf "\n" | pecl install apcu; fi
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]]; then phpenv config-rm xdebug.ini; fi
- if [[ $TRAVIS_PHP_VERSION = 'hhvm' ]]; then mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d; fi
- printf "\n" | pecl install -f apcu
- phpenv config-rm xdebug.ini
- phpenv config-add docker/php/config/php.ini
- composer self-update
- composer install --prefer-source --optimize-autoloader
Expand All @@ -23,3 +18,10 @@ script:
- bin/benchmark --horizontal-complexity 4 --iteration 100
- bin/benchmark --vertical-complexity 4 --iteration 100
- bin/benchmark --horizontal-complexity 4 --vertical-complexity 4 --iteration 100
- bin/benchmark --horizontal-complexity 20 --vertical-complexity 100 --iteration 100
- vendor/bin/phpbench run src/SerializerBenchmarks/JmsSerializerBench.php --report=aggregate --revs=10 --iterations=10 --retry-threshold=5 --dump-file=a.xml
- vendor/bin/phpbench run src/SerializerBenchmarks/IvorySerializerBench.php --report=aggregate --revs=10 --iterations=10 --retry-threshold=5 --dump-file=b.xml
- vendor/bin/phpbench run src/SerializerBenchmarks/BetterSerializerBench.php --report=aggregate --revs=10 --iterations=10 --retry-threshold=5 --dump-file=c.xml
- vendor/bin/phpbench run src/SerializerBenchmarks/SymfonyGsNormSerializerBench.php --report=aggregate --revs=1 --iterations=1 --dump-file=d.xml
- vendor/bin/phpbench run src/SerializerBenchmarks/SymfonyObjNormSerializerBench.php --report=aggregate --revs=1 --iterations=1 --dump-file=e.xml
- vendor/bin/phpbench report --file=a.xml --file=b.xml --file=c.xml --file=d.xml --file=e.xml --report=compare
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ which represents a complexity factor:
$ docker-compose run --rm php bin/benchmark --vertical-complexity 4
```

Symfony serializer isn't included in the benchmarking process by default, because it is very slow.
If you'd like to benchmark also the Symfony serializer, you can use the `with-symfony-serializer` option:

``` bash
$ docker-compose run --rm php bin/benchmark --with-symfony-serializer
```

## PhpBench integration

All the benchmarks were also integrated with PhpBench, to provide more trustful results. You can run the benchmarks
using these commands:

```bash
$ vendor/bin/phpbench run src/SerializerBenchmarks/JmsSerializerBench.php --report=aggregate --revs=10 --iterations=10 --retry-threshold=5 --dump-file=a.xml
$ vendor/bin/phpbench run src/SerializerBenchmarks/IvorySerializerBench.php --report=aggregate --revs=10 --iterations=10 --retry-threshold=5 --dump-file=b.xml
$ vendor/bin/phpbench run src/SerializerBenchmarks/BetterSerializerBench.php --report=aggregate --revs=10 --iterations=10 --retry-threshold=5 --dump-file=c.xml
$ vendor/bin/phpbench run src/SerializerBenchmarks/SymfonyGsNormSerializerBench.php --report=aggregate --revs=1 --iterations=1 --dump-file=d.xml
$ vendor/bin/phpbench run src/SerializerBenchmarks/SymfonyObjNormSerializerBench.php --report=aggregate --revs=1 --iterations=1 --dump-file=e.xml
$ vendor/bin/phpbench report --file=a.xml --file=b.xml --file=c.xml --file=d.xml --file=e.xml --report=compare
```

## Contribute

We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR!.
Expand Down
16 changes: 11 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"require": {
"php": "^5.6|^7.0",
"php": "^7.1",
"doctrine/cache": "^1.0",
"egeloen/serializer": "^1.0",
"jms/serializer": "^1.0",
"jms/serializer": "^1.12",
"symfony/polyfill-apcu": "^1.0",
"symfony/cache": "^3.0",
"symfony/console": "^3.0",
"symfony/property-access": "^3.0",
"symfony/serializer": "^3.0",
"symfony/yaml": "^3.0"
"symfony/yaml": "^3.0",
"pimple/pimple": "~3.0",
"phpbench/phpbench": "^1.0@dev",
"better-serializer/better-serializer": "^0.1",
"symfony/serializer": "^v4.1"
},
"autoload": {
"psr-4": { "Ivory\\Tests\\Serializer\\Benchmark\\": "src/" }
"psr-4": {
"Ivory\\Tests\\Serializer\\Benchmark\\": "src/",
"SerializerBenchmarks\\": "src/SerializerBenchmarks/"
}
},
"minimum-stability": "dev"
}
Loading