-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 732a300
Showing
104 changed files
with
1,888 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
/composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<p align="center"> | ||
<img src="http://www.phpbenchmarks.com/images/logo_github.png"> | ||
<br> | ||
<a href="http://www.phpbenchmarks.com" target="_blank">www.phpbenchmarks.com</a> | ||
</p> | ||
|
||
## What is www.phpbenchmarks.com ? | ||
|
||
You will find lot of benchmarks for PHP frameworks and template engines. | ||
|
||
You can compare results between Apache Bench and Siege, and PHP 5.6 to 7.3. | ||
|
||
## What is this repository ? | ||
|
||
It's benchmark common code for Symfony serializer benchmarks. | ||
|
||
Switch branch to select your Symfony serializer major version and benchmark you want to see. | ||
|
||
See all Symfony serializer benchmarked versions on [phpbenchmarks/symfony-serializer](https://github.com/phpbenchmarks/symfony-serializer). | ||
|
||
You can find how we benchmark on [phpbenchmarks.com](http://phpbenchmarks.loc:8081/fr/documentation/benchmarking-protocol). | ||
|
||
## How versions works ? | ||
|
||
We do not follow semantic version for this repository. Here is an explanation about our versioning system: | ||
|
||
`X` related to Symfony serializer major version (`2` Symfony serializer ^2, `3` Symfony serializer ^3, `4` Symfony serializer ^4) | ||
|
||
`Y` benchmark type (`6` Serialization of Hello World, `7` Serialization to a small JSON, `8` Serialization to a big JSON) | ||
|
||
`Z` new version, not just bugfix and could contains BC | ||
|
||
## Benchmarks | ||
|
||
You can find all Symfony serializer benchmarks results on [phpbenchmarks.com](http://phpbenchmarks.com/en/benchmark/symfony-json-serializer/version). | ||
|
||
Scores are too low ? Do not hesitate to create a pull request, and [ask a new benchmark](http://phpbenchmarks.com/en/contact)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "phpbenchmarks/symfony-serializer-common", | ||
"license": "proprietary", | ||
"require": { | ||
"php": "^5.4||^7.0", | ||
"symfony/serializer": "^2.1||^3.0||^4.0", | ||
"phpbenchmarks/benchmark-json-serialization-small-overload": "1.0.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"PhpBenchmarks\\SymfonySerializerCommon\\": "src/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use PhpBenchmarks\BenchmarkJsonSerializationSmallOverload\ObjectToSerialize\ObjectToSerialize; | ||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class ObjectToSerializeNormalizer implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof ObjectToSerialize; | ||
} | ||
|
||
/** @param ObjectToSerialize $object */ | ||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
return [ | ||
'property1' => $object->getProperty1(), | ||
'property2' => $object->getProperty2(), | ||
'property3' => $object->getProperty3(), | ||
'property4' => $object->getProperty4(), | ||
'property5' => $object->getProperty5(), | ||
'property6' => $object->getProperty6(), | ||
'property7' => $object->getProperty7(), | ||
'property8' => $object->getProperty8(), | ||
'property9' => $object->getProperty9(), | ||
'property10' => $object->getProperty10() | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer1 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer10 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer11 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer12 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer13 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer14 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer15 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer16 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer17 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer18 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer19 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer2 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer20 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer21 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer22 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace PhpBenchmarks\SymfonySerializerCommon\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class OverloadNormalizer23 implements NormalizerInterface | ||
{ | ||
public function supportsNormalization($data, $format = null, array $context = []) | ||
{ | ||
return $data instanceof UnknownObject; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
throw new \Exception(__CLASS__ . '::' . __FUNCTION__ . ' should not be called.'); | ||
} | ||
} |
Oops, something went wrong.