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

ActiveFlarum-extension

huoxin/benchmark-tool
=====================

A headless CLI performance benchmarking tool for Flarum

2.0.1(1mo ago)0296↓75%MITPHPCI passing

Since Jul 12Pushed 1mo agoCompare

[ Source](https://github.com/huoxin233/flarum-ext-benchmark-tool)[ Packagist](https://packagist.org/packages/huoxin/benchmark-tool)[ RSS](/packages/huoxin-benchmark-tool/feed)WikiDiscussions 1.x Synced 1w ago

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

Flarum Benchmark Tool
=====================

[](#flarum-benchmark-tool)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/616dd6e3b536ca5fac0b72ce668e2863f56f8439625c90ea48113b9a03e5e98f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68756f78696e2f62656e63686d61726b2d746f6f6c2e737667)](https://packagist.org/packages/huoxin/benchmark-tool) [![Review](https://camo.githubusercontent.com/c033169a125128b4d44c5115c0984aa9ebe2bd88dfe3ca97c2695565f114dd9c/68747470733a2f2f666c6f78756d2e636f6d2f657874656e73696f6e2f68756f78696e2f62656e63686d61726b2d746f6f6c2f62616467652f726576696577)](https://floxum.com/extension/huoxin/benchmark-tool) [![Review Score](https://camo.githubusercontent.com/20f9ede21f042dfe83f051559cd547704dab9019789d3b2bfcd94a3937196c52/68747470733a2f2f666c6f78756d2e636f6d2f657874656e73696f6e2f68756f78696e2f62656e63686d61726b2d746f6f6c2f62616467652f7265766965772d73636f7265)](https://floxum.com/extension/huoxin/benchmark-tool)

A headless, internal performance benchmarking tool for Flarum.

This extension exposes the `php flarum benchmark:run` CLI command, which simulates HTTP requests, executes raw PHP/SQL, bypasses the web server stack, and records execution time and database query latency.

**Note:** This extension is designed to be orchestrated by the [Flarum Benchmark Suite GitHub Action](https://github.com/huoxin233/flarum-benchmark-suite). It is not meant to be installed on production forums.

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

[](#installation)

Install with composer:

```
composer require huoxin/benchmark-tool:"*"
```

Updating
--------

[](#updating)

```
composer update huoxin/benchmark-tool:"*"
php flarum migrate
php flarum cache:clear
```

Usage (CLI)
-----------

[](#usage-cli)

```
php flarum benchmark:run --endpoint=/api/discussions --iterations=5
```

### Available Options

[](#available-options)

- `--endpoint=` (Default: `/api/discussions`) - The API endpoint to benchmark.
- `--method=` (Default: `GET`) - HTTP method (GET, POST, PATCH, DELETE).
- `--body=` - JSON string body for POST/PATCH requests.
- `--actor=` (Default: `1`) - User ID to execute the request as.
- `--iterations=` (Default: `5`) - Number of benchmark iterations to run.
- `--warmup` - Run an initial, unrecorded iteration to warm up the application cache, Eloquent boot traits, and OPcache.
- `--clear-cache` - Clear the Flarum Cache between every iteration.
- `--show-response` - Print the raw API response to the console.
- `--json-out=` - Output the raw performance metrics to a specific JSON file.
- `--setup-sql=` - Execute a raw SQL query before the benchmark begins.
- `--setup-php=` - Execute raw PHP code before the benchmark begins.
- `--benchmark-sql=` - Bypass the Flarum API and strictly benchmark a raw SQL query.
- `--benchmark-php=` - Bypass the Flarum API and strictly benchmark raw PHP code.

⚠️ Testing Production Data
--------------------------

[](#️-testing-production-data)

It is entirely possible to install this extension on a production server to hunt for bottlenecks against millions of real posts. However, **do not run this on a live server!**

1. **Security Risk**: The tool uses PHP's `eval()` to execute raw code via the `--benchmark-php` flag.
2. **Data Pollution**: Running a benchmark with `--method=POST` will spam your live database with fake data.
3. **Resource Spikes**: Benchmarking intentionally hammers the CPU and Database, causing severe slowdowns for real users.

**Best Practice**: Export your production database and import it into an isolated **local staging environment**. Install the benchmark tool there to safely measure performance!

If you do not need to test against real production data and just want to run simulated benchmarks for your extension, do not install this tool manually! Instead, use the **[Flarum Benchmark Suite](https://github.com/huoxin233/flarum-benchmark-suite)** GitHub Action to automatically orchestrate everything for you.

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/huoxin/benchmark-tool)
- [GitHub](https://github.com/huoxin233/flarum-ext-benchmark-tool)
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

47d ago

Major Versions

1.0.1 → 2.0.02026-07-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23447157?v=4)[huoxin](/maintainers/huoxin233)[@huoxin233](https://github.com/huoxin233)

---

Top Contributors

[![huoxin233](https://avatars.githubusercontent.com/u/23447157?v=4)](https://github.com/huoxin233 "huoxin233 (5 commits)")

---

Tags

flarum

### Embed Badge

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

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

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

13129.7k](/packages/flarum-lang-russian)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

2042.4k](/packages/flarum-lang-french)[fof/discussion-language

Specify the language a discussion is written in &amp; sort by language

1036.3k7](/packages/fof-discussion-language)

PHPackages © 2026

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