phpbenchmarks/benchmark-json-serialization-big-overload

Data for serialization to a big JSON benchmark on phpbenchmarks.com.

1.0.0 2019-05-12 18:09 UTC

This package is auto-updated.

Last update: 2024-05-13 04:36:05 UTC


README

687474703a2f2f7777772e70687062656e63686d61726b732e636f6d2f696d616765732f6c6f676f5f6769746875622e706e67
www.phpbenchmarks.com

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 benchmark.

You can find how we benchmark it on benchmarking protocol page.

Retrieve data to serialize

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.

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());
}