PHPackages                             arrayiterator/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. arrayiterator/profiler

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

arrayiterator/profiler
======================

Record &amp; profiling the code

10TypeScript

Since Oct 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ArrayIterator/php.profiler)[ Packagist](https://packagist.org/packages/arrayiterator/profiler)[ RSS](/packages/arrayiterator-profiler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Profiler
============

[](#php-profiler)

[![Code Checking](https://github.com/ArrayIterator/php.profiler/actions/workflows/code-checking.yml/badge.svg)](https://github.com/ArrayIterator/php.profiler/actions/workflows/code-checking.yml)

INSTALLATION
------------

[](#installation)

```
composer require arrayiterator/profiler
```

PROFILING
---------

[](#profiling)

```
use ArrayIterator\Profiler\Profiler;

$profiler = new Profiler();
// start the profiler
$performance = $profiler->start('benchmark', 'Group Name', ['data' => 'information']);
try {
    // do something with the code
    // write the code that you want to benchmark
} finally {
    // best practice to stop the profiler using try -> finally
    // using finally to make sure the profiler is stopped
    $performance->stop(['additional' => 'information']);
    // or using profiler object
    // the group name is important when you have different group of benchmark
    // the group: default, as default group
    // the name of benchmark also important to identify the benchmark
    $profiler->stop('benchmark', 'Group Name', ['additional' => 'information']);
}
```

RENDERING TOOLBAR
-----------------

[](#rendering-toolbar)

```
/**
 * @var \ArrayIterator\Profiler\Profiler $profiler
 */
$waterfall = $profiler->getWaterfall();

// render the toolbar
$darkMode = null; // set true if default dark mode or let it null when using autodetect
$content = $waterfall->renderJs($darkMode);

// can be echo or append to stream
// echo $content;
// append to stream interface (PSR-7)
// $response->getBody()->write($content);
```

PREVIEW
-------

[](#preview)

[![Toolbar Preview](images/preview-dark.png)](images/preview-dark.png)[![Toolbar Preview](images/preview-light.png)](images/preview-light.png)

ATTENTION
---------

[](#attention)

This package still under development, the profiler is ready but the UI is not yet ready. The UI is still under development.

But the profiler is ready to use, you can use it by installing the package and use the profiler. You can customize the implementation of the Frontend or Backend.

UI &amp; IMPLEMENTATION OF RENDERER
-----------------------------------

[](#ui--implementation-of-renderer)

Typescript &amp; scss \[**[assets](assets)**\] is used to create the UI, the UI is created using the following technologies:

Maximum record size is 5000 records, if more than 5000 records, the UI will not render the benchmark. (maximum record size can be changed in the preferences). When the record less than 5000 and set less than record, can be reset with:

```
window.arrayiterator_waterfall.set_max_records(5000);
```

### REQUIREMENT:

[](#requirement)

- PHP 7.4 or later
- Composer
- DEV (Node.js (npm) - for installing the dependencies)

### TASKS

[](#tasks)

> BACKEND

- Benchmark Profiler
- Memory Profiler
- Time Profiler
- Render Profiler
- Code Styling &amp; PhpStan

> FRONTEND

- ToolBar (Chrome Like)
- Dark Mode &amp; Light Mode (Auto Detect)
- Resizeable
- Responsiveness
- Action Size
    - Maximize
    - Minimize (restore)
    - Close
- Benchmark Tab
    - Filtering
    - Waterfall Profiling
    - Importer
    - Exporter
    - Restorer
    - Message (information about the import, export, restore)
    - Input Search
    - Horizontal Resizable Section
- Labs Tab (Under Development)
    - Profiler Information
    - Metadata of JSON
    - RAM Usage &amp; Limit (chart using pie chart from highchart.js)
    - Additional Information
    - Chart for benchmark
- Source Tab

#### Benchmark Tab

[](#benchmark-tab)

- Filtering
    - Importer
    - Exporter
    - Restorer
    - Message (information about the import, export, restore)
    - General Filter
    - Performance Filter (Slow, Fast, Average)
    - Search Filter (Follow the benchmark content)
    - Aggregator Filter (Follow the benchmark aggregation)
- Waterfall Profiling
    - Using waterfall using div percentage
    - Add additional information for certain table
    - Clickable to show the detail of the benchmark

#### Labs Tab

[](#labs-tab)

- Profiler Information
    - Metadata of JSON
    - RAM Usage &amp; Limit (chart using pie chart from highchart.js)
    - Additional Information
    - Chart for benchmark

#### Source Tab

[](#source-tab)

- Code Section
    - Prettify/Minify the source code
    - Download the source code
    - Import the source code

DEPENDENCIES
------------

[](#dependencies)

- Template Engine using [SquirrellyJS](https://squirrelly.js.org/)
- Chart using [HighChart](https://www.highcharts.com/)
- Icon &amp; SVG using [HeroIcons](https://heroicons.com/)
- Compiled JS using [Webpack](https://webpack.js.org/) &amp; [TypeScript](https://www.typescriptlang.org/)
- Compiled CSS using [Sass](https://sass-lang.com/)

NOTE
----

[](#note)

Rendering benchmark &amp; source code using looping og `setTimeout` to make sure the rendering is not blocking the main thread.

LICENSE
-------

[](#license)

[MIT License](LICENSE)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb0f33448498e932b0d1b70d2290614c2b62bbcbd545fe236f5866a4b636ca26?d=identicon)[ArrayIterator](/maintainers/ArrayIterator)

---

Top Contributors

[![ArrayIterator](https://avatars.githubusercontent.com/u/37867551?v=4)](https://github.com/ArrayIterator "ArrayIterator (6 commits)")

---

Tags

benchmarkingphp-profilerphp-profilingprofiling

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/arrayiterator-profiler/health.svg)](https://phpackages.com/packages/arrayiterator-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)[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)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

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