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

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

dragon-code/benchmark
=====================

Simple comparison of code execution speed between different options

4.5.1(3mo ago)11934.7k↓44.9%35MITPHPPHP ^8.2CI passing

Since Feb 3Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/TheDragonCode/benchmark)[ Packagist](https://packagist.org/packages/dragon-code/benchmark)[ Fund](https://boosty.to/dragon-code)[ Fund](https://yoomoney.ru/to/410012608840929)[ RSS](/packages/dragon-code-benchmark/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (44)Used By (5)

Benchmark
=========

[](#benchmark)

  ![Benchmark](https://camo.githubusercontent.com/2790c2c6f1264c2789845423bec6ca245f663ffabee86a016384695a67a880fd/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f42656e63686d61726b2e706e673f7061747465726e3d746f706f677261706879267374796c653d7374796c655f3226666f6e7453697a653d3130307078266d643d312673686f7757617465726d61726b3d31267468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b726571756972652b2d2d646576267061636b6167654e616d653d647261676f6e2d636f646525324662656e63686d61726b266465736372697074696f6e3d53696d706c652b636f6d70617269736f6e2b6f662b636f64652b657865637574696f6e2b73706565642b6265747765656e2b646966666572656e742b6f7074696f6e7326696d616765733d68747470732533412532462532467777772e7068702e6e6574253246696d616765732532466c6f676f732532466e65772d7068702d6c6f676f2e737667)[![Stable Version](https://camo.githubusercontent.com/19d600c23341c6e1e865fe13d21d51e060e92a3bf66c0b76a02d557eea03195d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f546865447261676f6e436f64652f62656e63686d61726b3f6c6162656c3d737461626c65267374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/benchmark)[![Total Downloads](https://camo.githubusercontent.com/7dd21e1305830f33f9c60339bb9f9d2362d235ae8c977eeade44fc1d8ce6e181/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647261676f6e2d636f64652f62656e63686d61726b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/benchmark)[![Github Workflow Status](https://camo.githubusercontent.com/04cdb0ea4a8eb30ebda6849de480524cd31d5345668990a2ca9e915a04fcc479/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f546865447261676f6e436f64652f62656e63686d61726b2f74657374732e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/TheDragonCode/benchmark/actions)[![License](https://camo.githubusercontent.com/3cc7bbc4bb0c0838f406e07a96244aad325fed626887c7fafc02255fa131edaa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f647261676f6e2d636f64652f62656e63686d61726b2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

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

[](#installation)

To get the latest version of `Benchmark`, simply require the project using [Composer](https://getcomposer.org):

```
composer require dragon-code/benchmark --dev
```

Or manually update `require-dev` block of `composer.json` and run `composer update` console command:

```
{
    "require-dev": {
        "dragon-code/benchmark": "^4.0"
    }
}
```

Usage
-----

[](#usage)

> Note
>
> The result of the execution is printed to the console, so make sure you call the code from the console.

### Quick Start

[](#quick-start)

```
use function DragonCode\Benchmark\bench;

bench()
    ->compare(
        static fn () => true,
        static fn () => true
    )
    ->toConsole();
```

### How To Use

[](#how-to-use)

You can use both the `bench()` function and the `Benchmark` class.

```
use function DragonCode\Benchmark\bench;

bench()->compare([
    fn () => /* some code */,
    fn () => /* some code */,
])->toConsole();

new Benchmark()->compare([
    fn () => /* some code */,
    fn () => /* some code */,
])->toConsole();
```

#### As a function

[](#as-a-function)

```
use function DragonCode\Benchmark\bench;

// Array without named keys
bench()->compare([
    fn () => /* some code */,
    fn () => /* some code */,
])->toConsole();

// Array with named keys
bench()->compare([
    'foo' => fn () => /* some code */,
    'bar' => fn () => /* some code */,
])->toConsole();

// Callbacks without named parameters
bench()->compare(
    fn () => /* some code */,
    fn () => /* some code */,
)->toConsole();

// Callbacks with named parameters
bench()->compare(
    foo: fn () => /* some code */,
    bar: fn () => /* some code */,
)->toConsole();
```

#### As a class

[](#as-a-class)

```
use DragonCode\Benchmark\Benchmark;

// Array without named keys
new Benchmark()->compare([
    fn () => /* some code */,
    fn () => /* some code */,
])->toConsole();

// Array with named keys
new Benchmark()->compare([
    'foo' => fn () => /* some code */,
    'bar' => fn () => /* some code */,
])->toConsole();

// Callbacks without named parameters
new Benchmark()->compare(
    fn () => /* some code */,
    fn () => /* some code */,
)->toConsole();

// Callbacks with named parameters
new Benchmark()->compare(
    foo: fn () => /* some code */,
    bar: fn () => /* some code */,
)->toConsole();
```

Example output with named keys:

```
+-------+-------------------------+-------------------------+
| #     | foo                     | bar                     |
+-------+-------------------------+-------------------------+
| min   | 14.3472 ms - 0 bytes    | 14.3657 ms - 0 bytes    |
| max   | 15.7684 ms - 0 bytes    | 15.7249 ms - 0 bytes    |
| avg   | 15.0967475 ms - 0 bytes | 14.9846725 ms - 0 bytes |
| total | 1207.7398 ms - 0 bytes  | 1198.7738 ms - 0 bytes  |
+-------+-------------------------+-------------------------+
| order | 2                       | 1                       |
+-------+-------------------------+-------------------------+
```

When measuring the average value among the results, when more than 9 iterations are used, the final data is filtered by peak values. The calculation of the 10% of the lowest and 10% of the highest values is excluded from the total result, thus the final data becomes cleaner and less dependent on any external factors.

### Iterations Count

[](#iterations-count)

By default, the benchmark performs 100 iterations per callback, but you can change this number by calling the `iterations` method:

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->iterations(5)
    ->compare([
        'foo' => fn () => /* some code */,
        'bar' => fn () => /* some code */,
    ])
    ->toConsole();
```

If a negative value is passed, its absolute value will be used.

For example:

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->iterations(-20) // Will result in 20 iterations
    // ...
```

You can also get the number of the current execution iteration from the input parameter:

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->iterations(5)
    ->compare(
        fn (int $iteration) => /* some code */,
        fn (int $iteration) => /* some code */,
    )
    ->toConsole();
```

### Round Precision

[](#round-precision)

By default, the script does not round measurement results, but you can specify the number of decimal places to which rounding can be performed.

This method only affects the console output (the `toConsole` method).

For example:

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->round(2)
    ->compare([
        'foo' => fn () => /* some code */,
        'bar' => fn () => /* some code */,
    ])
    ->toConsole();
```

Result example:

```
+-------+----------------------+----------------------+
| #     | foo                  | bar                  |
+-------+----------------------+----------------------+
| min   | 14.58 ms - 0 bytes   | 14.38 ms - 0 bytes   |
| max   | 15.55 ms - 0 bytes   | 15.71 ms - 0 bytes   |
| avg   | 15.01 ms - 0 bytes   | 15.1 ms - 0 bytes    |
| total | 1201.09 ms - 0 bytes | 1207.76 ms - 0 bytes |
+-------+----------------------+----------------------+
| order | 1                    | 2                    |
+-------+----------------------+----------------------+
```

### Deviation Values

[](#deviation-values)

In some cases, it is necessary to test not only the functionality of the options themselves, but also to determine the level of deviation between them. To do this, use the `deviations` method.

When you specify this method during a call, all your loops will repeat the specified number of times. Meanwhile, the resulting table and DTO will display values from the results, where:

- `min` - minimum among all result values
- `max` - maximum among all results
- `avg` - arithmetic mean of all result values
- `total` - the total value among the values of all results
- `deviation` - deviation calculated from the mean of all results

For example:

```
new Benchmark()
    ->deviations(4)
    ->iterations(5)
    ->compare(
        foo: fn () => /* some code */,
        bar: fn () => /* some code */,
    )
    ->toConsole();
```

```
+------------------+----------------------+-----------------------+
| #                | foo                  | bar                   |
+------------------+----------------------+-----------------------+
| min              | 0.0011 ms - 0 bytes  | 0.0009 ms - 0 bytes   |
| max              | 0.0111 ms - 0 bytes  | 0.0082 ms - 0 bytes   |
| avg              | 0.00453 ms - 0 bytes | 0.002715 ms - 0 bytes |
| total            | 0.0906 ms - 0 bytes  | 0.0543 ms - 0 bytes   |
+------------------+----------------------+-----------------------+
| order            | 2                    | 1                     |
+------------------+----------------------+-----------------------+
| deviation time   | +0.002768            | +0.000919             |
| deviation memory | 0                    | 0                     |
+------------------+----------------------+-----------------------+
```

#### To understand work without deviations

[](#to-understand-work-without-deviations)

```
$iterations = 10;
$result = [];

for ($i = 0; $i < $iterations; $i++) {
    $result[] = /* perform some code */;
}

return $result;
```

#### To understand work with deviations

[](#to-understand-work-with-deviations)

```
$iterations = 10;
$deviations = 4;
$result = [];

for ($i = 0; $i < $deviations; $i++) {
    $insideResult = [];

    for ($j = 0; $j < $iterations; $j++) {
        $insideResult[] = /* perform some code */;
    }

    $result[] = $this->performResult($insideResult);
}

return $result;
```

### Callbacks

[](#callbacks)

#### Before

[](#before)

In some cases, you may need to perform certain actions before running the benchmark loop.

You can do this by calling the `before` method with a callback.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->before(fn () => /* some code */)
    ->compare(
        fn () => /* some code */,
        fn () => /* some code */,
    )
    ->toConsole();
```

The loop name is passed to the callback as a parameter. You can use this information if needed.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->before(fn (int|string $name) => /* some code */)
    ->compare(
        fn () => /* some code */,
        fn () => /* some code */,
    )
    ->toConsole();
```

#### BeforeEach

[](#beforeeach)

In some cases, you may need to perform certain actions before each benchmark iteration.

You can do this by calling the `beforeEach` method with a callback.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->beforeEach(fn () => /* some code */)
    ->compare(
        fn () => /* some code */,
        fn () => /* some code */,
    )
    ->toConsole();
```

The loop name and iteration number are passed to the callback as parameters. Additionally, the result of the `beforeEach` callback is passed to the compare callback itself. You can use this information if needed.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->beforeEach(fn (int|string $name, int $iteration) => /* some code */)
    ->compare(
        fn (mixed $before) => /* some code */,
        fn (mixed $before) => /* some code */,
    )
    ->toConsole();
```

#### After

[](#after)

In some cases, you may need to perform certain actions after the benchmark loop has completed.

You can do this by calling the `after` method with a callback.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->after(fn () => /* some code */)
    ->compare(
        fn () => /* some code */,
        fn () => /* some code */,
    )
    ->toConsole();
```

The loop name is passed to the callback as a parameter. You can use this information if needed.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->after(fn (int|string $name) => /* some code */)
    ->compare(
        fn () => /* some code */,
        fn () => /* some code */,
    )
    ->toConsole();
```

#### AfterEach

[](#aftereach)

In some cases, you may need to perform certain actions after each benchmark iteration.

You can do this by calling the `afterEach` method with a callback.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->afterEach(fn () => /* some code */)
    ->compare(
        fn () => /* some code */,
        fn () => /* some code */,
    )
    ->toConsole();
```

The loop name and iteration number are passed to the callback as parameters. You can use this information if needed.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->afterEach(fn (int|string $name, int $iteration) => /* some code */)
    ->compare(
        fn () => /* some code */,
        fn () => /* some code */,
    )
    ->toConsole();
```

### Results

[](#results)

Use one of the following methods to obtain benchmark results.

#### toConsole

[](#toconsole)

This method outputs the benchmark results to the console.

##### Option 1

[](#option-1)

```
new Benchmark()
    ->round(2)
    ->compare([
        'foo' => static fn () => /* some code */,
        'bar' => static fn () => /* some code */,
    ])
    ->toConsole();
```

```
+-------+---------------------+----------------------+
| #     | foo                 | bar                  |
+-------+---------------------+----------------------+
| min   | 14.56 ms - 0 bytes  | 14.62 ms - 0 bytes   |
| max   | 15.85 ms - 0 bytes  | 15.65 ms - 0 bytes   |
| avg   | 15.08 ms - 0 bytes  | 15.12 ms - 0 bytes   |
| total | 1206.7 ms - 0 bytes | 1209.44 ms - 0 bytes |
+-------+---------------------+----------------------+
| order | 1                   | 2                    |
+-------+---------------------+----------------------+
```

##### Option 2

[](#option-2)

```
new Benchmark()
    ->round(2)
    ->compare([
        static fn () => /* some code */,
        static fn () => /* some code */,
    ])
    ->toConsole();
```

```
+-------+----------------------+----------------------+
| #     | 0                    | 1                    |
+-------+----------------------+----------------------+
| min   | 14.52 ms - 0 bytes   | 14.42 ms - 0 bytes   |
| max   | 15.78 ms - 0 bytes   | 15.7 ms - 0 bytes    |
| avg   | 15.09 ms - 0 bytes   | 15.01 ms - 0 bytes   |
| total | 1207.56 ms - 0 bytes | 1200.55 ms - 0 bytes |
+-------+----------------------+----------------------+
| order | 2                    | 1                    |
+-------+----------------------+----------------------+
```

##### Option 3

[](#option-3)

```
new Benchmark()
    ->round(2)
    ->compare(
        static fn () => /* some code */,
        static fn () => /* some code */,
    )
    ->toConsole();
```

```
+-------+----------------------+----------------------+
| #     | 0                    | 1                    |
+-------+----------------------+----------------------+
| min   | 14.52 ms - 0 bytes   | 14.56 ms - 0 bytes   |
| max   | 15.68 ms - 0 bytes   | 15.61 ms - 0 bytes   |
| avg   | 15.1 ms - 0 bytes    | 15.04 ms - 0 bytes   |
| total | 1207.73 ms - 0 bytes | 1203.17 ms - 0 bytes |
+-------+----------------------+----------------------+
| order | 2                    | 1                    |
+-------+----------------------+----------------------+
```

##### Option 4

[](#option-4)

```
new Benchmark()
    ->round(2)
    ->compare(
        foo: static fn () => /* some code */,
        bar: static fn () => /* some code */,
    )
    ->toConsole();
```

```
+-------+----------------------+----------------------+
| #     | foo                  | bar                  |
+-------+----------------------+----------------------+
| min   | 14.68 ms - 0 bytes   | 14.56 ms - 0 bytes   |
| max   | 15.69 ms - 0 bytes   | 15.64 ms - 0 bytes   |
| avg   | 15.13 ms - 0 bytes   | 15.07 ms - 0 bytes   |
| total | 1210.38 ms - 0 bytes | 1205.26 ms - 0 bytes |
+-------+----------------------+----------------------+
| order | 2                    | 1                    |
+-------+----------------------+----------------------+
```

##### Option 5: With Deviation Values

[](#option-5-with-deviation-values)

```
new Benchmark()
    ->deviations(4)
    ->round(2)
    ->compare(
        foo: static fn () => /* some code */,
        bar: static fn () => /* some code */,
    )
    ->toConsole();
```

```
+------------------+-----------------------+---------------------+
| #                | 0                     | 1                   |
+------------------+-----------------------+---------------------+
| min              | 15.68 ms - 202 bytes  | 2.35 ms - 102 bytes |
| max              | 112.79 ms - 209 bytes | 9.76 ms - 109 bytes |
| avg              | 53.03 ms - 205 bytes  | 5.94 ms - 105 bytes |
| total            | 1696.81 ms - 6.42 KB  | 190.17 ms - 3.30 KB |
+------------------+-----------------------+---------------------+
| order            | 2                     | 1                   |
+------------------+-----------------------+---------------------+
| deviation time   | +0.100715             | +0.114023           |
| deviation memory | 0                     | 0                   |
+------------------+-----------------------+---------------------+
```

#### toData

[](#todata)

This method returns benchmark results as an array of `DragonCode\Benchmark\Data\ResultData` DTO objects.

You can use it in your application for your own purposes.

```
return new Benchmark()
    ->compare(
        foo: fn () => /* some code */,
        bar: fn () => /* some code */,
    )
    ->toData();
```

```
array:2 [
  "foo" => DragonCode\Benchmark\Data\ResultData {#17
    +min: DragonCode\Benchmark\Data\MetricData {#19
      +time: 14.6123
      +memory: 0.0
    }
    +max: DragonCode\Benchmark\Data\MetricData {#20
      +time: 15.7372
      +memory: 0.0
    }
    +avg: DragonCode\Benchmark\Data\MetricData {#21
      +time: 15.12268875
      +memory: 0.0
    }
    +total: DragonCode\Benchmark\Data\MetricData {#22
      +time: 1209.8151
      +memory: 0.0
    }
  }
  "bar" => DragonCode\Benchmark\Data\ResultData {#23
    +min: DragonCode\Benchmark\Data\MetricData {#24
      +time: 14.3369
      +memory: 0.0
    }
    +max: DragonCode\Benchmark\Data\MetricData {#25
      +time: 15.8259
      +memory: 0.0
    }
    +avg: DragonCode\Benchmark\Data\MetricData {#26
      +time: 15.10940625
      +memory: 0.0
    }
    +total: DragonCode\Benchmark\Data\MetricData {#27
      +time: 1208.7525
      +memory: 0.0
    }
  }
]
```

##### With Deviation Values

[](#with-deviation-values)

When calling the benchmark with deviation calculation, the DTO will contain the `deviations` property:

```
return new Benchmark()
    ->deviations()
    ->compare(
        foo: fn () => /* some code */,
        bar: fn () => /* some code */,
    )
    ->toData();
```

```
array:2 [
  "foo" => DragonCode\Benchmark\Data\ResultData {#23
    +min: DragonCode\Benchmark\Data\MetricData {#64
      +time: 0.001
      +memory: 0.0
    }
    +max: DragonCode\Benchmark\Data\MetricData {#65
      +time: 0.0036
      +memory: 0.0
    }
    +avg: DragonCode\Benchmark\Data\MetricData {#66
      +time: 0.0024209375
      +memory: 0.0
    }
    +total: DragonCode\Benchmark\Data\MetricData {#67
      +time: 0.7747
      +memory: 0.0
    }
    +deviation: DragonCode\Benchmark\Data\DeviationData {#68
      +percent: DragonCode\Benchmark\Data\MetricData {#69
        +time: 0.0007048383984778
        +memory: 0.0
      }
    }
  }
  "bar" => DragonCode\Benchmark\Data\ResultData {#70
    +min: DragonCode\Benchmark\Data\MetricData {#71
      +time: 0.001
      +memory: 0.0
    }
    +max: DragonCode\Benchmark\Data\MetricData {#72
      +time: 0.0032
      +memory: 0.0
    }
    +avg: DragonCode\Benchmark\Data\MetricData {#73
      +time: 0.00242875
      +memory: 0.0
    }
    +total: DragonCode\Benchmark\Data\MetricData {#74
      +time: 0.7772
      +memory: 0.0
    }
    +deviation: DragonCode\Benchmark\Data\DeviationData {#75
      +percent: DragonCode\Benchmark\Data\MetricData {#76
        +time: 0.00061642429076895
        +memory: 0.0
      }
    }
  }
]
```

#### toAssert

[](#toassert)

This method allows you to validate benchmark results against expected values.

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->compare(/* ... */)
    ->toAssert()

    ->toBeMinTime(from: 0.5, till: 3)       // between 0.5 and 3 ms
    ->toBeMaxTime(from: 0.5, till: 3)       // between 0.5 and 3 ms
    ->toBeAvgTime(from: 0.5, till: 3)       // between 0.5 and 3 ms
    ->toBeTotalTime(from: 0.5, till: 9)     // between 0.5 and 9 ms

    ->toBeMinMemory(from: 0, till: 1024)    // between 0 and 1024 bytes
    ->toBeMaxMemory(from: 0, till: 1024)    // between 0 and 1024 bytes
    ->toBeAvgMemory(from: 0, till: 1024)    // between 0 and 1024 bytes
    ->toBeTotalMemory(from: 0, till: 4096)  // between 0 and 4096 bytes

    ->toBeDeviationTime(from: -0.5, till: 0.5)   // deviation time must be between -0.5% and 0.5%
    ->toBeDeviationMemory(from: -2.5, till: 2.5) // deviation memory must be between -2.5% and 2.5%
```

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->compare(/* ... */)
    ->toAssert()

    ->toBeMinTime(from: 0.5)       // time must be greater than or equal to 0.5 ms
    ->toBeMaxTime(from: 0.5)       // time must be greater than or equal to 0.5 ms
    ->toBeAvgTime(from: 0.5)       // time must be greater than or equal to 0.5 ms
    ->toBeTotalTime(from: 0.5)     // time must be greater than or equal to 0.5 ms

    ->toBeMinMemory(till: 1024)    // the memory footprint should not exceed 1024 bytes
    ->toBeMaxMemory(till: 1024)    // the memory footprint should not exceed 1024 bytes
    ->toBeAvgMemory(till: 1024)    // the memory footprint should not exceed 1024 bytes
    ->toBeTotalMemory(till: 4096)  // the memory footprint should not exceed 4096 bytes

    ->toBeDeviationTime(from: -0.5)  // deviation time must be greater than or equal to -0.5%
    ->toBeDeviationMemory(till: 2.5) // deviation memory must be less than or equal to 2.5%
```

### Disable Progress Bar

[](#disable-progress-bar)

In some cases, it is necessary to disable the progressbar so that it does not interfere in the console.

To do this, use the `disableProgressBar` method:

```
use DragonCode\Benchmark\Benchmark;

new Benchmark()
    ->disableProgressBar()
    // ...
```

License
-------

[](#license)

This package is licensed under the [MIT License](LICENSE).

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance82

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~31 days

Recently: every ~0 days

Total

37

Last Release

90d ago

Major Versions

v1.5.1 → v2.0.02023-02-06

2.x-dev → 3.0.02024-03-23

3.x-dev → 4.0.02026-02-14

PHP version history (2 changes)v1.0.0PHP ^8.1

3.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![andrey-helldar](https://avatars.githubusercontent.com/u/10347617?v=4)](https://github.com/andrey-helldar "andrey-helldar (324 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")[![roxblnfk](https://avatars.githubusercontent.com/u/4152481?v=4)](https://github.com/roxblnfk "roxblnfk (1 commits)")

---

Tags

benchmarkcomparatorcomparatorscomparisoncomparison-toolruntimespeedspeedtesttimetimercomparatortimetimercomparisonruntimebenchmarkspeedcomparatorsspeedtestcomparison-tool

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[symfony/clock

Decouples applications from the system clock

430168.9M205](/packages/symfony-clock)[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)[phootwork/lang

Missing PHP language constructs

1224.8M8](/packages/phootwork-lang)[icecave/chrono

A date &amp; time library that is decoupled from the system clock.

54188.9k7](/packages/icecave-chrono)

PHPackages © 2026

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