2017 © Pedro Peláez
 

library benchmark

Relative memory & time benchmarking in PHP for PHP

image

almadomundo/benchmark

Relative memory & time benchmarking in PHP for PHP

  • Monday, April 28, 2014
  • by almadomundo
  • Repository
  • 1 Watchers
  • 7 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

benchmark

Benchmark is a very simple tool that allows to measure functions in PHP., (*1)

Currently, there are two standard measurements: memory space and time., (*2)

Important note: this tool is created for comparative measurements. That means - it is good only to compare memory/time usage of two or more functions. If you want to get exact memory/time measurements - using this tool is not a good idea because it's realization wraps many things inside class, calls internal methods e t.c. - i.e. it does many things that cause measurements overhead., (*3)

Memory

To measure memory, it's enough to use \Benchmark\Measure::benchmarkMemory method - it measures maximum memory space that was used during function execution, (*4)

Time

To measure time, solid amount of iterations should be applied. Method is \Benchmark\Measure::benchmarkTime Also make sure that your script has enough time limitations, otherwise your script will fail because this measure tool does not affects any context and so you should adjust your maximum script execution time by yourself (using set_time_limit() for example)., (*5)

Custom

You may specify any measurement function and use it in \Benchmark\Measure::benchmarkCustom - the only restriction is that value, returned by this measurement function must be numeric value., (*6)

The Versions

28/04 2014

dev-master

9999999-dev

Relative memory & time benchmarking in PHP for PHP

  Sources   Download

GPLv2

The Requires

  • php >=5.3.0