Download the PHP package hoa/bench without Composer
On this page you can find all versions of the php package hoa/bench. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package bench
Short Description The Hoa\Bench library.
License BSD-3-Clause
Homepage https://hoa-project.net/
Informations about the package bench
Hoa is a modular, extensible and
structured set of PHP libraries.
Moreover, Hoa aims at being a bridge between industrial and research worlds.
Hoa\Bench
This library allows to analyze performance of algorithms or programs by placing some “marks” in the code. Furthermore, this library provides some DTrace programs.
Installation
With Composer, to include this library into
your dependencies, you need to
require hoa/bench
:
For more installation procedures, please read the Source page.
Testing
Before running the test suites, the development dependencies must be installed:
Then, to run all the test suites:
For more information, please read the contributor guide.
Quick usage
We propose a quick overview of two usages: The library itself and one DTrace program.
Benchmark
All we have to do is to place different marks in the code. A mark can be
started, paused, stopped and reset. The class Hoa\Bench\Bench
proposes a quick
statistic graph that could be helpful:
More operations are available, such as iterating over all marks, deleting a mark, filters marks etc.
DTrace
An interesting DTrace program is hoa://Library/Bench/Dtrace/Execution.d
that
shows the call trace, errors and exceptions during an execution. For example, if
we consider the Dtrace.php
file that contains the following code:
Then, we can run DTrace like this:
Another program shows statistics about an execution: Each function that has been called, how many times, how long the execution has taken etc.
Documentation
The
hack book of Hoa\Bench
contains detailed information about how to use this library and how it works.
To generate the documentation locally, execute the following commands:
More documentation can be found on the project's website: hoa-project.net.
Getting help
There are mainly two ways to get help:
- On the
#hoaproject
IRC channel, - On the forum at users.hoa-project.net.
Contribution
Do you want to contribute? Thanks! A detailed contributor guide explains everything you need to know.
License
Hoa is under the New BSD License (BSD-3-Clause). Please, see
LICENSE
for details.
Related projects
The following projects are using this library:
- Symfony Bench Bundle,
The
Hoa\Bench
Symfony 2 bundle.