PHPackages                             eandrews737/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. eandrews737/benchmarker

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

eandrews737/benchmarker
=======================

Will Benchmark PHP Functions For Food

0.0.5(6y ago)112PHPPHP &gt;=7.2.0CI failing

Since Jun 4Pushed 1y agoCompare

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

READMEChangelogDependencies (1)Versions (5)Used By (0)

PHP Function Benchmarker
========================

[](#php-function-benchmarker)

A PHP package that takes in an array of functions and gives the user a report that ranks the runtime performance of each one. So far the functions will be ranked by min, max or average times. The report is customizable and currently supports JSON, console printing or file printing.

Current Version:

```
0.1.0

```

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

```
Requires PHP 8.1.2

```

### Installing

[](#installing)

This project is a `composer` package. To install this library to your project run:

```
composer require eandrews737/benchmarker

```

[Find it on Packagist](https://packagist.org/packages/eandrews737/benchmarker)

Using the Project
-----------------

[](#using-the-project)

To use the project simply install the package and add:

```
require 'vendor/eandrews737/benchmarker/src/benchmark.php';
use Benchmarker\Benchmarker;

```

Then make a call to the benchmark function on the benchmaker class. Example Call:

```
Benchmarker::benchmark(["function1", "function2"], 5, true, 'json');

```

### Parameters

[](#parameters)

- `functions` (required array) - Array of functions.
- `executionAmount` (int) - Amount of times to test each function. Defaults to 1.
- `isAscSort` (boolean) - Whether or not to arrange the info in an ascending or descending order. Defaults to ascending.
- `printStyle` (string) - Printing format. Defaults to JSON.

See next section for more details about `printStyle`.

### Reporter

[](#reporter)

Supported formats:

- `raw` - returns an object containing arrays of the data
- `file` - returns a formatted string of the data saved to a file called benchmark.txt
- `string` - returns a formatted string of the data
- `json` - returns the data is a JSON format

Running Tests
-------------

[](#running-tests)

Unit testing for this project utilizes `phpunit`.

### Unit Testing

[](#unit-testing)

Testing for this project requires consistent times. So a simple test would be comparing a very slow function against a fast one. The results should always be consistent 99% of the time.

Go into the tests folder and run the following command:

```
phpunit test.php

```

While in the root directory, of course.

Built With
----------

[](#built-with)

- [phpunit](https://phpunit.de/getting-started/phpunit-8.html) - Unit Testing Framework
- [Composer](https://getcomposer.org/) - Dependency Management

Authors
-------

[](#authors)

[ME](https://github.com/eandrews737)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

4

Last Release

2530d ago

### Community

Maintainers

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

---

Top Contributors

[![eandrews737](https://avatars.githubusercontent.com/u/18400964?v=4)](https://github.com/eandrews737 "eandrews737 (31 commits)")

---

Tags

benchmarkphp7benchmark

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[devster/ubench

Micro PHP library for benchmarking

5701.0M29](/packages/devster-ubench)[christophrumpel/artisan-benchmark

Benchmark Artisan Commands

17966.6k](/packages/christophrumpel-artisan-benchmark)[dragon-code/benchmark

Simple comparison of code execution speed between different options

11934.7k5](/packages/dragon-code-benchmark)[ayesh/php-timer

High-resolution and monotonic stop-watch for all your needs. Supports timer start, pause, resume, stop, read, and minimal conversion.

22226.4k11](/packages/ayesh-php-timer)

PHPackages © 2026

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