PHPackages                             nochso/benchmark - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. nochso/benchmark

ActiveLibrary[Testing &amp; Quality](/categories/testing)

nochso/benchmark
================

Benchmark with reliable results

0.5.3(10y ago)01221ISCPHP

Since Sep 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/nochso/Benchmark)[ Packagist](https://packagist.org/packages/nochso/benchmark)[ RSS](/packages/nochso-benchmark/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (12)Versions (11)Used By (1)

nochso/benchmark library
========================

[](#nochsobenchmark-library)

[![Latest Stable Version](https://camo.githubusercontent.com/6f673812d16f571c3b279f39712cc06713eabc5ae5e8efdbfb3723a3a0c7d127/68747470733a2f2f706f7365722e707567782e6f72672f6e6f6368736f2f62656e63686d61726b2f762f737461626c65)](https://packagist.org/packages/nochso/benchmark)[![License](https://camo.githubusercontent.com/a51604bf6dd3b3777b935a8d7add5486867edd3ee398b87973e4692691e4fd76/68747470733a2f2f706f7365722e707567782e6f72672f6e6f6368736f2f62656e63686d61726b2f6c6963656e7365)](LICENSE)

nochso/benchmark creates pretty HTML benchmarks from any closures you supply:

- Generate HTML reports including Github flavoured Markdown
- Reliably compare different algorithms
- Run tests for a minimum amount of time to ensure stable results

[**View an example report**](http://nochso.github.io/Benchmark/reports/search.html)

[**View the API documentation**](http://nochso.github.io/Benchmark/docs/nochso/Benchmark.html)

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [History](#history)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

1. Install composer on Linux / Unix / OSX or Windows
2. Require this package via composer:

    ```
    composer require nochso/benchmark
    ```

Usage
-----

[](#usage)

Have a look at the [example reports](reports/).

A very simple example without parameters:

```
$report = new Report('My report name');
$unit = new Unit('Encryption speed');
$unit->addClosure(function ($n) {
    while ($n--) {
        $x = str_rot13('secret');
    }
}, 'rot13');
$unit->addClosure(function ($n) {
    while ($n--) {
        $x = str_rot13(str_rot13('secret'));
    }
}, 'rot26');
$report->unitList->add($unit);
$report->run();
```

This will generate and save a HTML report to folder `build` by default.

### Options

[](#options)

The Report constructor takes an optional third argument `$config`:

```
public function __construct($title, $description = '', $config = array())
```

If omitted, default options will be used. Otherwise your configuration will be merged with the defaults.

```
array(
    'template_dir' => 'template',
    'output_dir'   => 'build',
    'twig'         => array(
        'cache'            => 'cache/twig',
        'auto_reload'      => true,
        'strict_variables' => true,
    ),
)
```

You can also change the minimum duration of tests which defaults to 1000 millseconds (1 second):

```
\nochso\Benchmark\Timer::$defaultMinDuration = 1000;
```

Contributing
------------

[](#contributing)

1. [Open an issue](https://github.com/nochso/benchmark/issues/new) if it's worth discussing.
2. Fork this project on Github.
3. Clone your fork: `git clone git@github.com:yourname/benchmark.git`
4. Don't forget to `composer update`
5. Create your feature branch: `git checkout -b my-new-feature`
6. Commit your changes: `git commit -am 'Add some feature'`
7. Push to the branch: `git push origin my-new-feature`
8. Submit a pull request on Github :)

Change log
----------

[](#change-log)

See [CHANGELOG](CHANGELOG.md).

Credits
-------

[](#credits)

- [Marcel Voigt](https://github.com/nochso)

License
-------

[](#license)

This project is licensed under the ISC license which is MIT/GPL compatible and FSF/OSI approved:

```
Copyright (c) 2015, Marcel Voigt

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~48 days

Total

8

Last Release

3726d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6887618?v=4)[Marcel Voigt](/maintainers/nochso)[@nochso](https://github.com/nochso)

---

Top Contributors

[![nochso](https://avatars.githubusercontent.com/u/6887618?v=4)](https://github.com/nochso "nochso (107 commits)")

---

Tags

testingperformanceoptimizationbenchmarktiming

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nochso-benchmark/health.svg)

```
[![Health](https://phpackages.com/badges/nochso-benchmark/health.svg)](https://phpackages.com/packages/nochso-benchmark)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M731](/packages/sylius-sylius)[phpbench/phpbench

PHP Benchmarking Framework

2.0k14.6M831](/packages/phpbench-phpbench)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M560](/packages/shopware-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M200](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
