PHPBench is a benchmark runner for PHP. It enables you to write standard benchmarks for your application and classes and helps you to make smart decisions based on comparative results.

Features at a glance:

  • Revolutions and Iterations: Spin and repeat.
  • Process Isolation: Benchmarks are run in separate processes with no significant overhead from the runner.
  • Reporting: Powerful and extensible reports.
  • Deferred Reporting: Dump benchmarking results to an XML file and report on them later.
  • Memory Usage: Keep an eye on the amount of memory used by benchmarking subjects.

Why PHPBench?

Performance can be monitored and measured in a number of ways: profiling (via. XDebug or Blackfire), injecting timing classes (e.g. Symfony Stopwatch, Hoa Bench) or with server tools such as NewRelic.

PHPBench differs from these tools in that it allows you to benchmark explicit scenarios independently of the application context, and to run these scenarios multiple times in order to obtain a degree of confidence about the stability of the results.

As a tool it is analogous to the test framework PHPUnit, but instead of tests we run benchmarks and generate reports.

Are There Other Benchmarking Frameworks?

You can try Athletic .