All Projects β†’ tsantos84 β†’ serializer-benchmark

tsantos84 / serializer-benchmark

Licence: other
A PHP benchmark application to compare PHP serializer libraries

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to serializer-benchmark

autobench
Benchmark your application on CI
Stars: ✭ 16 (+14.29%)
Mutual labels:  benchmark, performance-analysis
best
πŸ† Delightful Benchmarking & Performance Testing
Stars: ✭ 73 (+421.43%)
Mutual labels:  benchmark, performance-analysis
Crossplatformdisktest
Windows, macOS and Android storage (HDD, SSD, RAM) speed testing/performance benchmarking app
Stars: ✭ 123 (+778.57%)
Mutual labels:  benchmark, performance-analysis
benchmark-malloc
Trace memory allocations and collect stats
Stars: ✭ 18 (+28.57%)
Mutual labels:  benchmark, performance-analysis
IGUANA
IGUANA is a benchmark execution framework for querying HTTP endpoints and CLI Applications such as Triple Stores. Contact: [email protected]
Stars: ✭ 22 (+57.14%)
Mutual labels:  benchmark, performance-analysis
S3 Benchmark
Measure Amazon S3's performance from any location.
Stars: ✭ 525 (+3650%)
Mutual labels:  benchmark, performance-analysis
Dbtester
Distributed database benchmark tester
Stars: ✭ 214 (+1428.57%)
Mutual labels:  benchmark, performance-analysis
SciMLBenchmarks.jl
Benchmarks for scientific machine learning (SciML) software and differential equation solvers
Stars: ✭ 195 (+1292.86%)
Mutual labels:  benchmark
allie
πŸ€– A machine learning framework for audio, text, image, video, or .CSV files (50+ featurizers and 15+ model trainers).
Stars: ✭ 93 (+564.29%)
Mutual labels:  data-transformation
hashcatbenchmark
Benchmark in Hashcat for diferents GPU's
Stars: ✭ 19 (+35.71%)
Mutual labels:  benchmark
go-perftuner
Helper tool for manual Go code optimization.
Stars: ✭ 111 (+692.86%)
Mutual labels:  benchmark
docker-google-lighthouse-puppeteer
Google Lighthouse + Puppeteer / Docker Image
Stars: ✭ 29 (+107.14%)
Mutual labels:  performance-analysis
docker-magento2
🐳 Environment for a Magento2 application using Docker.
Stars: ✭ 52 (+271.43%)
Mutual labels:  blackfire
HeCBench
software.intel.com/content/www/us/en/develop/articles/repo-evaluating-performance-productivity-oneapi.html
Stars: ✭ 85 (+507.14%)
Mutual labels:  benchmark
http bench
golang HTTP stress test tool, support single and distributed
Stars: ✭ 142 (+914.29%)
Mutual labels:  benchmark
benchmark
Parse Server Continuous Benchmark
Stars: ✭ 21 (+50%)
Mutual labels:  benchmark
c2clat
A tool to measure CPU core to core latency
Stars: ✭ 37 (+164.29%)
Mutual labels:  benchmark
npm-yarn-benchmark
Bash script for comparing NPM and Yarn performance
Stars: ✭ 42 (+200%)
Mutual labels:  benchmark
latenz
JavaScript HTTP latency analyzer
Stars: ✭ 18 (+28.57%)
Mutual labels:  benchmark
RGBD-SODsurvey
RGB-D Salient Object Detection: A Survey
Stars: ✭ 171 (+1121.43%)
Mutual labels:  benchmark

Serializer Benchmark Build Status

This project aims to compare the performance of some most used and few less known JSON serialization libraries for PHP.

Inspiration

This benchmark attempts to compare serialization libraries performance-wise. All of the libraries have their own features, support different formats, added magic and other stuff, but for the sake of simplicity it was decided to simplify sample data to fit all of them.

The core of benchmarking set was implemented by Tales Santos, the author of TSantos serializer.

Instalation

Clone this repository in your workspace

git clone https://github.com/tsantos84/serializers-benchmarking.git

Install the application's dependencies

Using system installed composer

composer install -a --no-dev

or using composer in docker container:

docker run --rm --interactive --tty -v $(pwd):/app composer install -a --no-dev

Execution

The benchmark application can be executed as is with PHP 7.1 and above.

php vendor/bin/phpbench run --warmup=1 --report=tsantos

If you don't have PHP of required version you may use suitable Docker PHP image (PHP 7.1-cli-alpine).

docker run --rm -it -v $(pwd):/opt -w /opt php:7.1-cli-alpine php vendor/bin/phpbench run --warmup=1 --report=tsantos --group=serialize

Application parameters

There're 2 available benchmark groups:

  • serialize - run serialization benchmark only
  • deserialize - run deserialization benchmark only
php vendor/bin/phpbench run --warmup=1 --report=tsantos --group=serialize

Vendors

It is possible to see all the serializer libraries available in this benchmark and its version:

php vendor/bin/phpbench vendors

Benchmark Tool

This project was written based on PHPBench. Please, refer to its documentation page for further reading about all its runner options.

Blackfire Integration

Blackfire is a excelent tool to profile PHP applications and helps you to discover some bottleneck points. This project allows you to run benchmarks and send the call-graph to Blackfire's server so you can see how each library works internally.

Installation

In order to start using Blackfire, you first need to sign up on Blackfire.io and then you'll have access to your credentials.

Agent

Creates a new docker container with the Blackfire's Agent:

docker run -d \
  --name="blackfire" \
  -e BLACKFIRE_SERVER_ID={YOUR_BLACKFIRE_SERVER_ID_HERE} \
  -e BLACKFIRE_SERVER_TOKEN={YOUR_BLACKFIRE_SERVER_TOKEN_HERE} \
  blackfire/blackfire

PHP Executable

Create a custom PHP image with Blackfire extension installed and enabled:

cd /path/to/serializer-benchmark
docker build -t benchmark -f Dockerfile.blackfire .

Running the application

Now you can run the application using the PHP image create on step before:

docker run \
  --rm \
  -it \
  -v $(pwd):/opt \
  -w /opt \
  -e BLACKFIRE_CLIENT_ID={YOUR_BLACKFIRE_CLIENT_ID_HERE} \
  -e BLACKFIRE_CLIENT_TOKEN={YOUR_BLACKFIRE_CLIENT_TOKEN_HERE} \
  --link blackfire:blackfire \
  benchmark php vendor/bin/phpbench run --warmup=1 --report=tsantos --group=serialize --executor=blackfire

Docker Compose

Instead of running each container manually, you can use docker-compose to run the benchmarks. To accomplish this you need to create a copy of the docker-compose.yaml.dist file:

cp docker-compose.yml.dist docker-compose.yml

and run one of the following commands:

# perform serialization benchmark
docker-compose run --rm bench_serialize

# perform deserialization benchmark
docker-compose run --rm bench_deserialize

# perform serialization benchmark with Blackfire enabled
docker-compose run --rm bench_serialize_blackfire \
    -e BLACKFIRE_SERVER_ID={YOUR_BLACKFIRE_SERVER_ID} \
    -e BLACKFIRE_SERVER_TOKEN={YOUR_BLACKFIRE_SERVER_TOKEN} \
    -e BLACKFIRE_CLIENT_ID={YOUR_BLACKFIRE_CLIENT_ID} \
    -e BLACKFIRE_CLIENT_TOKEN={YOU_BLACKFIRE_CLIENT_TOKEN}

# perform deserialization benchmark with Blackfire enabled
docker-compose run --rm bench_deserialize_blackfire \
    -e BLACKFIRE_SERVER_ID={YOUR_BLACKFIRE_SERVER_ID} \
    -e BLACKFIRE_SERVER_TOKEN={YOUR_BLACKFIRE_SERVER_TOKEN} \
    -e BLACKFIRE_CLIENT_ID={YOUR_BLACKFIRE_CLIENT_ID} \
    -e BLACKFIRE_CLIENT_TOKEN={YOU_BLACKFIRE_CLIENT_TOKEN}

As you have your own copy of the docker-compose.yml file, you can define those environment variables there and save time when run the benchmarks with Blackfire enabled.

Note

By running the benchmark with Blackfire enabled you'll realize that the mean time will increase substantially. This behavior is expected because the Blackfire needs to introspect in your code and hence affects the benchmark metrics.

Contribution

Want to see more libraries in this benchmark? You can easily add new benchmarks by implementing the BenchInterface interface or extending the AbstractBench class which has a lot of help methods. Please, take a look at some of existing bench classes and you'll see how you can write your own benchmark.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].