Skip to content

v1.0.0

Choose a tag to compare

@hyperized hyperized released this 11 Apr 22:05
· 2 commits to master since this release
97712eb

PHP Benchmark v1.0.0

First release — a comprehensive PHP server benchmarking utility with 15 modules.

Benchmark Modules

Category Module What it measures
Environment PHP Version, ini settings, memory limits, loaded extensions
I/O Disk I/O File creation across 8 block sizes (512B–64KB)
File Read Sequential reads across file sizes (1KB–4MB)
Network DNS resolution and TCP connection latency
Compute CPU Math functions, string operations, loops, conditionals
Memory Allocation speed and peak memory per operation
Regex preg_match and preg_replace across 10 pattern types
JSON Encode/decode with small, medium, and large payloads
Serialization serialize vs json_encode vs var_export (+ igbinary/msgpack)
Hashing md5, sha1, sha256, sha512, xxh3, crc32, hmac-sha256, bcrypt, argon2id
Encryption AES-128/256-CBC/GCM, ChaCha20-Poly1305
Compression gzip, zlib, deflate (+ brotli/lzf) with compression ratios
Runtime Function Overhead Named function, closure, first-class callable, static/instance method
Type Casting int/string/float/bool conversions
Object Instantiation stdClass, DateTime, SplStack, SplPriorityQueue, ArrayObject
Database MySQL Query performance

Features

  • Dual output modes — auto-detects CLI (ANSI colors + Unicode box-drawing) vs web (styled HTML dashboard)
  • JSON reports — each run saves a timestamped report to reports/
  • All timings in milliseconds for readability
  • CLI progress indicator — shows which module is running with colored [3/15] Running Hashing...
  • Fully configurable — enable/disable modules, set cycle counts, override output format
  • Code quality — PHPStan level 8, PHP-CS-Fixer PER-CS2.0, GitHub Actions CI

Requirements

  • PHP >= 8.4
  • ext-mysqli (optional, for MySQL benchmarks)

Quick Start

composer create-project hyperized/benchmark v1.0.0
cp config/config.yml.example config/config.yml
php benchmark.php