Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phpbenchmarks/benchmark-json-serialization-big-overload
Dependency for small JSON serialization benchmark
https://github.com/phpbenchmarks/benchmark-json-serialization-big-overload
benchmark php serializer symfony
Last synced: 8 days ago
JSON representation
Dependency for small JSON serialization benchmark
- Host: GitHub
- URL: https://github.com/phpbenchmarks/benchmark-json-serialization-big-overload
- Owner: phpbenchmarks
- Created: 2019-05-12T18:07:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-12T18:23:21.000Z (over 5 years ago)
- Last Synced: 2024-04-20T11:46:20.103Z (7 months ago)
- Topics: benchmark, php, serializer, symfony
- Language: PHP
- Homepage: http://www.phpbenchmarks.com
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 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, PHP 5.6 to 7.3 and versions of your favorites PHP code.
## What is this repository?
It's dependency for [big JSON serialization](http://www.phpbenchmarks.com/en/documentation/benchmark/json-serialization-big-overload) benchmark.
You can find how we benchmark it on [benchmarking protocol page](http://www.phpbenchmarks.com/en/documentation/benchmarking-protocol).
## Retrieve data to serialize
```php
use PhpBenchmarks\BenchmarkJsonSerializationBigOverload\BenchmarkService;BenchmarkService::getDataToSerialize();
```## Validation of serialization
As serialization don't need to write anything to response body,
when we validate your serialization we add a parameter into query string
to indicate you need to write serialization result into response body.```php
use PhpBenchmarks\BenchmarkJsonSerializationBigOverload\BenchmarkService;// Write serialized data to response body if isWriteToResponseBody() return true, to validate it.
if (BenchmarkService::isWriteToResponseBody()) {
echo $serializer->serialize(BenchmarkService::getDataToSerialize());// Only serialize data if isWriteToResponseBody() return false, to benchmark it.
} else {
$serializer->serialize(BenchmarkService::getDataToSerialize());
}
```