Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.38 KB

readme.md

File metadata and controls

41 lines (25 loc) · 1.38 KB

Benchmarks

lxHive supports testing with PHPBench.

A phpbench.json.dist file is setup in the project root folder of your lxHive app.

Installing PHPBench

PHPBench requires PHP >= 7.1 and is therefore NOT included as a composer dependency.

You can either install PHPBench globally or fetch the Phar locally into lxHive root.

cd <lxhive-root>
curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar
curl -o phpbench.phar.pubkey https://phpbench.github.io/phpbench/phpbench.phar.pubkey

phpbench.phar and phpbench.pharpubkey are excluded via .gitignore.

Usage

php phpbench.phar run <options>

You may create your custom configuration file (phpbench.json) in the root folder. This file is excluded via .gitignore

Structure

namespace folder notes
\Bench benchmarks/*
  • Benchmark Classes have to have the *Bench suffix, i.e. BootstrapBench
  • Benchmark methods have to have the bench* prefix, i.e. benchFactory()

Benchmark files are included in .gitignore (except the example), thus you can freely create your own tests.

See documentation: http://phpbench.readthedocs.io/en/latest/writing-benchmarks.html