PHPackages                             minond/profiler - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. minond/profiler

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

minond/profiler
===============

PHP profiler

2404PHP

Since Jan 31Pushed 12y ago1 watchersCompare

[ Source](https://github.com/minond/Profiler)[ Packagist](https://packagist.org/packages/minond/profiler)[ RSS](/packages/minond-profiler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Profiler
========

[](#profiler)

Important note
--------------

[](#important-note)

It is important to note this is a very simple profiler and should only be used to get an idea of a script's performance.

Profiler
--------

[](#profiler-1)

Creating new profilers:

```
use util\profile\Profiler;
use util\profile\Snapshot;

$profiler = new Profiler('AcmeAnvils');
```

Starting up and shutting down a profiler:

```
$profiler->start();
$profiler->stop();
```

Listening to profiler events:

```
// triggered by calling Profiler::start
$profiler->on('start', function(Snapshot $snapshot) {
  youroutput('profiling: %s', $snapshot->name);
});

// triggered on every PHP tick
$profiler->on('tick', function(Snapshot $snapshot) {
  youroutput('.');
});

// triggered by calling Profiler::stop
// you'll at least want to register to this event,
// otherwise the profiling data it worthless
$profiler->on('stop', function(Snapshot $snapshot) {
  youroutput('done profiling: %s', $snapshot->name);
  print_r($snapshot);
});
```

It is not necessary to call the `stop` method on a profiler, as it will register a shutdown function that will trigger a call to `stop`.

Profiling
---------

[](#profiling)

Sample of profiling code:

```
use util\profile\Profiler;
use util\profile\Snapshot;

$profiler = new Profiler('AcmeAnvils');
$profiler->start();
$profiler->on('stop', function(Snapshot $snapshot) {
  print_r($snapshot);
});

// code you want to profile
// ...

$profiler->stop();
```

Snapshot
--------

[](#snapshot)

Sample `Snapshot` object:

```
object(util\profile\Snapshot)[33]
  public 'name' => string 'AcmeAnvils' (length=10)
  public 'mode' => int 2
  public 'maxmemory' => int 1135472
  public 'avgmemory' => float 1128570.4
  public 'currentmemory' => int 1128568
  public 'currenttime' => float 1368675239.0269
  public 'starttime' => float 1368675239.0263
  public 'startmemory' => int 1122604
  public 'endtime' => float 1368675239.0269
  public 'endmemory' => int 1128520
  public 'runtime' => float 0.00060391426086426
  public 'trace' =>
    array (size=5)
      0 =>
        array (size=7)
          'file' => string 'file.php' (length=53)
          'line' => int 10
          'function' => string 'function_name' (length=14)
          'class' => null
          'type' => null
          'memory' => int 1126948
          'time' => float 1368675239.0264
```

Reports
-------

[](#reports)

Reports are used to output Snapshot objects in a human/environment friendly format:

```
use util\profile\reports\Chart;

$chart = new Chart;
$chart->prepare($snapshot);
$chart->configure(['chart_type' => 'LineChart']);
echo $chart->output();
```

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

[](#installation)

Install via composer: `"minond/profiler": "dev-master"`

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3edcb2fa5ed594ffb1c9d8d8c36c06540b74755f4cdef4d4e69d71c3c7c7495e?d=identicon)[minond](/maintainers/minond)

---

Top Contributors

[![minond](https://avatars.githubusercontent.com/u/601509?v=4)](https://github.com/minond "minond (35 commits)")

### Embed Badge

![Health badge](/badges/minond-profiler/health.svg)

```
[![Health](https://phpackages.com/badges/minond-profiler/health.svg)](https://phpackages.com/packages/minond-profiler)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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