Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bench Laravel Package

hoa/bench

hoa/bench is a lightweight PHP benchmarking library from the Hoa project. It helps measure execution time, compare code snippets, and profile performance with a simple API, making it easy to add repeatable benchmarks to PHP scripts and tests.

View on GitHub
Deep Wiki
Context7

The Hoa\Bench library.

Frequently asked questions about Bench
What is hoa/bench used for in PHP?
hoa/bench is a lightweight benchmarking library for measuring execution time of PHP code with named start and stop timers. It collects time points and reports aggregate statistics such as min, max, average, and standard deviation, so you can compare snippets or profile a critical path. It is part of the modular Hoa project and is framework-agnostic. It is best suited to isolated benchmark scripts and diagnostics rather than production request handling.
Can I use hoa/bench in a Laravel application?
You can conceptually install it in a Laravel project, but it has no Laravel service provider or framework integration and should only be used as a dev-only diagnostic tool. Do not put it in the production runtime path or require it for normal request handling. Isolate it in benchmark scripts or a small internal helper rather than spreading its API through application code. For Laravel request profiling, Telescope or Debugbar are more natural fits.
How do I install hoa/bench with Composer?
The package is installed with Composer as hoa/bench, typically using composer require --dev hoa/bench for diagnostic use. Because the package is archived and has transitive Hoa dependencies, test resolution in an isolated branch before committing. Pin the exact version in composer.lock and document why the dependency exists. Do not rely on it for release gating.
Is hoa/bench compatible with PHP 8 and modern Laravel versions?
There is no guaranteed compatibility with PHP 8.x or modern Laravel, because hoa/bench was last released on 2017-01-11 and has been archived since 2017. Modern Laravel apps usually run PHP 8.1+ and Composer 2, so the package or its transitive Hoa dependencies may fail to resolve or emit deprecations. You must run a sandbox spike against your target PHP, Laravel, and Composer versions. A clean Composer install is not proof that benchmark results reflect current PHP/JIT/opcache behavior.
Is hoa/bench maintained or archived?
hoa/bench is archived and has no active maintainer, with its last release on 2017-01-11. It has weak adoption signals, including zero dependents, so bugs, compatibility issues, and security concerns become the adopting team's responsibility. Retaining it implies accepting fork-or-patch ownership. Engineering leadership should explicitly accept the archived status before adoption.
Should hoa/bench be a dev dependency or production dependency?
Treat hoa/bench as an optional dev-only dependency, not production infrastructure. It should not be autoloaded in production deployments or used for production instrumentation. Keep it behind internal benchmark scripts or CI diagnostics with a documented owner and exit plan. If the need is production profiling, use Blackfire or Tideways instead.
How do I benchmark code with hoa/bench?
Use the simple start() and stop() API to wrap named benchmarks around the code you want to measure, and repeat measures to collect multiple time points. It supports multiple concurrent timers, so you can compare snippets or profile separate parts of a path. Then inspect the reported statistics to identify bottlenecks or validate an optimization. Keep the benchmark question and success criteria defined before you run it.
What statistics does hoa/bench provide?
Each benchmark exposes aggregate statistics including minimum, maximum, average, and standard deviation from the collected time points. Those figures help you compare implementations and see variance across repeated measures, not just a single elapsed time. Results can be rendered in flexible output formats for readable reports. Avoid coupling application code to a specific output format if you might migrate to another tool.
What are safer alternatives to hoa/bench for Laravel profiling?
Maintained alternatives include PHPBench for repeatable benchmark suites, Symfony Stopwatch for lightweight timing, Laravel Telescope or Debugbar for local request inspection, and Blackfire or Tideways for production-grade profiling. These reduce the risk of adopting an archived package with no security patch path. Choose based on whether you need micro-benchmarking, request profiling, regression detection, or ad hoc timing. Defaulting to a maintained tool is the lower-risk path.
Can I use hoa/bench for regression testing in CI?
You can run ad hoc benchmarks in CI, but hoa/bench is not a maintained regression-testing framework and should not gate releases. Benchmark execution can consume developer and CI time and memory, and unmaintained tooling may produce misleading results on current PHP/JIT/opcache behavior. If retained, pin it, restrict it to dev or CI diagnostics, and define its replacement before merging. PHPBench is a better fit for repeatable benchmark suites and regression detection.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console