PHPackages                             spencer-mortensen/benchmarker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. spencer-mortensen/benchmarker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spencer-mortensen/benchmarker
=============================

Benchmark snippets of code, gathering the mean and standard deviation for each snippet

0.0.2(7y ago)010GPL-3.0-or-laterPHPPHP &gt;=5.3.0

Since May 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Spencer-Mortensen/Benchmarker)[ Packagist](https://packagist.org/packages/spencer-mortensen/benchmarker)[ Docs](https://github.com/spencer-mortensen/benchmarker)[ RSS](/packages/spencer-mortensen-benchmarker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Benchmarker
===========

[](#benchmarker)

Benchmark snippets of code, gathering the mean and standard deviation for each snippet

Example
-------

[](#example)

Here's an example test:

```
use SpencerMortensen\Benchmarker\Test;

class ArrayTest implements Test
{
	public function run()
	{
		$t0 = microtime(true);

		array(
			'first' => 'Ann',
			'last' => 'Baker'
		);

		$t1 = microtime(true);

		return $t1 - $t0;
	}
}
```

And here's an example of the benchmarker:

```
$benchmarker = new Benchmarker();

$tests = array(
	'array' => array(new ArrayTest(), 10000),
);

$results = $benchmarker->run($tests);

echo $results, "\n"; // array: 5.0E-7 +- 1.1E-6
```

See the "example" directory for a working example.

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

[](#installation)

This project is available as a [Composer](https://getcomposer.org/) package ([spencer-mortensen/benchmarker](https://packagist.org/packages/spencer-mortensen/benchmarker)):

```
composer require spencer-mortensen/benchmarker

```

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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 ~0 days

Total

2

Last Release

2914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab3b16628454dcd5005930f417ba53fc7bc7eac0f7db768d25eef3bf30594f49?d=identicon)[spencermortensen](/maintainers/spencermortensen)

---

Top Contributors

[![spencer-mortensen](https://avatars.githubusercontent.com/u/2017476?v=4)](https://github.com/spencer-mortensen "spencer-mortensen (8 commits)")

---

Tags

phpbenchmark

### Embed Badge

![Health badge](/badges/spencer-mortensen-benchmarker/health.svg)

```
[![Health](https://phpackages.com/badges/spencer-mortensen-benchmarker/health.svg)](https://phpackages.com/packages/spencer-mortensen-benchmarker)
```

###  Alternatives

[christophrumpel/artisan-benchmark

Benchmark Artisan Commands

17966.6k](/packages/christophrumpel-artisan-benchmark)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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