Skip to content

About

Objective PHP runtime and framework benchmarking harness measuring RPS, latency, and memory with HTML charts in pure PHP

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

🇸🇦 العربية | 🇬🇧 English

⚡ eidcloud-php-bench

Release PHP Version License Open In Colab

Objective PHP Runtime & Framework Benchmark Lab measuring throughput (RPS), cold-boot startup, latency percentiles, JSON serialization, SQLite throughput, and memory-per-request with interactive HTML Chart.js reports in pure PHP 8.2+ (Zero external vendor dependencies).


🚀 Key Capabilities

  • Pure PHP 8.2+ Zero-Vendor Engine: Operates with native PHP standard library and built-in extensions (curl, json, pdo_sqlite). No composer install required to run benchmarks or reports.
  • Multi-Runtime Comparison: Comprehensive benchmarking analysis covering:
    • PHP-CLI: Standard ephemeral single-process execution.
    • PHP-FPM: Battle-tested pre-forked FastCGI worker pool.
    • RoadRunner: Persistent worker IPC via high-concurrency Go supervisor.
    • Swoole: Coroutine CSP async non-blocking event loop.
    • FrankPHP: Embedded C-Go SAPI with native HTTP/3 and 103 Early Hints.
  • Concurrent Load Testing Client: Non-blocking asynchronous load generation engine driven by curl_multi_* event loops, capturing exact percentile distributions (Min, Avg, P50, P90, P95, P99, Max).
  • In-Depth Micro-Benchmarks:
    • Subprocess cold-boot initialization latency (ms).
    • Heavy nested JSON serialization and decoding ops/sec.
    • Dynamic regex parameter route matching latency.
    • In-memory SQLite transaction write and read throughput.
  • Standalone Interactive HTML Reports: Generates zero-dependency responsive dark-mode HTML dashboards with embedded Chart.js visualizations.

🏗️ Architecture Workflow

flowchart TD
    A["CLI / BenchmarkLab"] --> B["MicroBenchmarker"]
    A --> C["ConcurrentClient (Multi-cURL)"]
    A --> D["MultiRuntimeComparator"]

    B --> B1["Cold-Boot Startup"]
    B --> B2["JSON Encode / Decode"]
    B --> B3["Regex Route Dispatch"]
    B --> B4["SQLite In-Memory DB"]

    C --> E["MetricsCollector"]
    E --> E1["Latency Percentiles (P50/P90/P95/P99)"]
    E --> E2["Throughput (RPS) & Status Codes"]
    E --> E3["Memory Delta & Peak Tracking"]

    D --> D1["PHP-CLI vs PHP-FPM vs Swoole vs RoadRunner vs FrankPHP"]

    B & E & D --> F["HtmlChartReport (Chart.js Dashboard)"]
    F --> G["bench_report.html"]
Loading

📦 Installation

Ensure PHP 8.2 or higher is installed:

git clone https://github.com/eidcloud/eidcloud-php-bench.git
cd eidcloud-php-bench

(Optional for library integration in other projects):

composer require eidcloud/php-bench

🛠️ Usage

1. Run Complete Benchmark Suite & Generate HTML Dashboard

php bin/eidcloud-php-bench run

2. High-Concurrency Live Target Load Test

php bin/eidcloud-php-bench run --target=http://localhost:8000 --concurrency=50 --requests=2000 --html=bench_report.html

3. Print Multi-Runtime Performance Matrix

php bin/eidcloud-php-bench compare

4. Re-generate HTML Report from Telemetry JSON

php bin/eidcloud-php-bench report --html=bench_report.html

5. CLI Help & Command Discovery

php bin/eidcloud-php-bench --help

🧪 Automated Testing

Zero-dependency test runner with 100% assertions pass rate:

php tests/run_tests.php

📊 Sample Output Preview

=================================================================
  ⚡ EIDCLOUD-PHP-BENCH - Objective PHP Performance Harness
=================================================================
Initializing benchmark suite...
PHP Version: 8.2.12
Mode: Micro-benchmarks & Runtime Architectural Lab
-----------------------------------------------------------------

[1/4] Measuring PHP cold-boot startup time... Done (3.82 ms avg)
[2/4] Benchmarking JSON serialization & parsing throughput... Done (312,450 ops/s encode)
[3/4] Testing regex URL routing latency... Done (1,420,110 ops/s)
[4/4] Profiling SQLite in-memory database throughput... Done (42,500 inserts/s)

-----------------------------------------------------------------
✓ Benchmark Suite Finished Successfully!
📄 Interactive HTML Chart Report: bench_report.html

👨‍💻 Author & Maintainer

  • Eng. MHD. Shadi AL-Hasan

📄 License

This project is open-sourced software licensed under the MIT License. Copyright (c) 2026 MHD. Shadi AL-Hasan.


👤 Author & Maintainer

Eng. MHD. Shadi AL-Hasan


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 MHD. Shadi AL-Hasan. All rights reserved.

About

Objective PHP runtime and framework benchmarking harness measuring RPS, latency, and memory with HTML charts in pure PHP

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages