承接 matraux/php-benchmark 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

matraux/php-benchmark

最新稳定版本:3.0.0

Composer 安装命令:

composer require matraux/php-benchmark

包简介

Benchmarking tool for PHP 8.4+ to measure code performance with accurate time and memory profiling.

README 文档

README

Latest Version on Packagist Last release License: MIT PHP Security Policy Contributing QA Status Issues Last Commit


Introduction

Simple and precise benchmarking for PHP 8.4+. Measures execution time and memory usage of code blocks with minimal overhead.


Features

  • High-precision time and memory measurement
  • Clean and readable syntax for benchmarking code blocks
  • Support for named measurements and grouped runs
  • Easy integration via callable or closure wrapping
  • Fluent API for accessing results
  • Minimal overhead, suitable for micro-benchmarking
  • Native support for PHP 8.4+ features
  • Integrates with Tracy for real-time benchmark visualization

Installation

composer require matraux/php-benchmark

Requirements

version PHP note
3.0.0 8.4+ Support PHP 8.4

Examples

See Tracy, Standalone or Console integration for advanced instructions.

use Matraux\PhpBenchmark\Benchmark\Benchmark;

$benchmark = new Benchmark;
$benchmark->label = 'Memory peak 20 MB';
$benchmark->counter = 10;
$benchmark->multiplier = 2;

$measurement = $benchmark->run(function (): string {
	return str_repeat(' ', 20 * 1024 * 1024);
});

echo $measurement->average; // Print average time (e.g. 44 ms)
echo $measurement->memory; // Print peak memory usage (e.g. 22 MB)

Development

See Development for debug, test instructions, static analysis, and coding standards.


Support

For bug reports and feature requests, please use the issue tracker.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固