PHPackages                             almadomundo/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. almadomundo/benchmark

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

almadomundo/benchmark
=====================

Relative memory &amp; time benchmarking in PHP for PHP

8211PHP

Since Apr 28Pushed 12y ago1 watchersCompare

[ Source](https://github.com/almadomundo/benchmark)[ Packagist](https://packagist.org/packages/almadomundo/benchmark)[ RSS](/packages/almadomundo-benchmark/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

benchmark
=========

[](#benchmark)

Benchmark is a very simple tool that allows to measure functions in PHP.

Currently, there are two standard measurements: memory space and time.

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.

Memory
======

[](#memory)

To measure memory, it's enough to use \\Benchmark\\Measure::benchmarkMemory method

- it measures maximum memory space that was used during function execution

Time
====

[](#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).

Custom
======

[](#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.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a1a71494eb72fe182341e533b7f0d2ab7681fe5eb75419cc4a2d150666329e0?d=identicon)[almadomundo](/maintainers/almadomundo)

---

Top Contributors

[![almadomundo](https://avatars.githubusercontent.com/u/5096484?v=4)](https://github.com/almadomundo "almadomundo (12 commits)")

### Embed Badge

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

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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