PHPackages                             hyperized/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. [Database &amp; ORM](/categories/database)
4. /
5. hyperized/benchmark

ActiveLibrary[Database &amp; ORM](/categories/database)

hyperized/benchmark
===================

A small PHP Benchmark project

v1.1.0(2mo ago)146113[2 PRs](https://github.com/hyperized/benchmark/pulls)MITPHPPHP &gt;=8.4CI passing

Since Sep 10Pushed 2mo agoCompare

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

READMEChangelog (2)Dependencies (7)Versions (14)Used By (0)

PHP benchmark
=============

[](#php-benchmark)

[![CI](https://github.com/hyperized/benchmark/actions/workflows/ci.yml/badge.svg)](https://github.com/hyperized/benchmark/actions/workflows/ci.yml)

Comprehensive PHP server benchmarking utility. Tests your hosting environment across 15 benchmark modules and reports results in milliseconds.

Auto-detects CLI vs web and renders with the appropriate output mode:

- **CLI** — ANSI colors with Unicode box-drawing tables
- **Web** — styled HTML dashboard with responsive CSS grid layout

Each run saves a JSON report with a timestamp to `reports/`.

Benchmark Modules
-----------------

[](#benchmark-modules)

CategoryModuleWhat it measures**Environment**PHPVersion, ini settings, memory limits, loaded extensions**I/O**Disk I/OFile creation across 8 block sizes (512B–64KB)File ReadSequential reads across file sizes (1KB–4MB)NetworkDNS resolution and TCP connection latency**Compute**CPUMath functions, string operations, loops, conditionalsMemoryAllocation speed and peak memory per operationRegex`preg_match` and `preg_replace` across 10 pattern typesJSONEncode/decode with small, medium, and large payloadsSerialization`serialize` vs `json_encode` vs `var_export` (+ igbinary/msgpack if available)Hashingmd5, sha1, sha256, sha512, xxh3, crc32, hmac-sha256, bcrypt, argon2idEncryptionAES-128/256-CBC/GCM, ChaCha20-Poly1305 encrypt and decryptCompressiongzip, zlib, deflate (+ brotli/lzf if available) with compression ratios**Runtime**Function OverheadNamed function, closure, first-class callable, static/instance method, arrow functionType Castingint/string/float/bool conversionsObject InstantiationstdClass, DateTime, SplStack, SplPriorityQueue, ArrayObject**Database**MySQLQuery performance (requires ext-mysqli)All modules can be individually enabled/disabled and configured in `config/config.yml`.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.4
- ext-mysqli (for MySQL benchmarks, optional)

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

[](#installation)

```
composer create-project hyperized/benchmark
cp config/config.yml.example config/config.yml
```

Adjust `config/config.yml` to your preferences. Set module toggles, cycle counts, MySQL credentials, and optionally override the output format.

Usage
-----

[](#usage)

### CLI

[](#cli)

```
php benchmark.php
```

Example output:

```
╔════════════════════════════════════════════════╗
║  PHP Benchmark Report                          ║
║  2026-04-11 14:30:22                           ║
╚════════════════════════════════════════════════╝

── PHP ───────────────────────────────────────────

  PHP Version     8.5.4
  Server          CLI
  Max Memory      128.00 MB
  Max Upload      2.00 MB
  Max Exec Time   0 seconds
  Extensions      67 loaded

── Disk I/O ──────────────────────────────────────

  Cycles: 100
  ms (lower is better)

  ┌──────────┬──────────┬──────────┬──────────┐
  │ 512.00 B │ 1.00 KB  │ 2.00 KB  │ 4.00 KB  │ ...
  ├──────────┼──────────┼──────────┼──────────┤
  │ 9.55ms   │ 9.78ms   │ 9.46ms   │ 10.97ms  │ ...
  └──────────┴──────────┴──────────┴──────────┘

── Hashing ───────────────────────────────────────

  Hash Functions (99999 cycles, ms, lower is better)

  ┌──────────┬──────────┬──────────┬──────────┬──────────┐
  │ md5      │ sha1     │ sha256   │ sha512   │ xxh3     │ ...
  ├──────────┼──────────┼──────────┼──────────┼──────────┤
  │ 143.00ms │ 155.71ms │ 387.45ms │ 288.95ms │ 16.35ms  │ ...
  └──────────┴──────────┴──────────┴──────────┴──────────┘

  ...

──────────────────────────────────────────────────
  Total Duration  18.657s
  Report saved    reports/2026-04-11_143022.json
──────────────────────────────────────────────────

```

### Web

[](#web)

```
php -S localhost:8000 benchmark.php
```

Open `http://localhost:8000` for a styled HTML dashboard with cards for each module.

### Remote

[](#remote)

Install on the server via Composer and visit `/benchmark.php` in the browser.

### Reports

[](#reports)

JSON reports are saved to `reports/` with timestamped filenames (e.g. `2026-04-11_143022.json`). Disable via `benchmark.output.report: false` in config.

### Configuration

[](#configuration)

All modules support `enabled: true/false` and configurable cycle counts:

```
benchmark:
  output:
    format: ~        # null = auto-detect, 'cli', or 'html'
    report: true     # save JSON report to reports/
  php:
    enabled: true
  disk:
    enabled: true
    cycles: 100
  memory:
    enabled: true
    count: 9999
  network:
    enabled: true
    cycles: 3
    hosts:
      - google.com
      - cloudflare.com
      - github.com
  hashing:
    enabled: true
    hashCount: 99999
    passwordCount: 10
  # ... see config/config.yml.example for all options
```

### Security

[](#security)

If deploying to a web server, ensure `config.yml` is not publicly accessible. For Apache with `mod_rewrite`:

```

    deny from all

```

Development
-----------

[](#development)

```
composer analyse    # Run PHPStan (level 8)
composer cs-fix     # Auto-fix code style (PER-CS2.0)
composer cs-check   # Check code style (dry run)
```

Contribution
------------

[](#contribution)

I'm open to improvements and new benchmarks via [pull requests](https://github.com/hyperized/benchmark/pulls).

Issues can be reported through [Issues](https://github.com/hyperized/benchmark/issues). Please include the full output of the script and your config file without the password.

License
-------

[](#license)

MIT

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance85

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 68% 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

79d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c854d21c83b5addf5f6c607968a353ff859d5bf8302659774d71b017f2f20d6?d=identicon)[hyperized](/maintainers/hyperized)

---

Top Contributors

[![hyperized](https://avatars.githubusercontent.com/u/827954?v=4)](https://github.com/hyperized "hyperized (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (1 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

benchmarkcpudiskmysqlmysqliphpserverphpmysqlmodulesbenchmarkdisk

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

249.4k](/packages/perplorm-perpl)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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