PHPackages                             abbadon1334/phpench - 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. abbadon1334/phpench

ActiveLibrary

abbadon1334/phpench
===================

A graphical PHP benchmarking tool - forked from mre/phpench

04PHP

Since Oct 10Pushed 3y agoCompare

[ Source](https://github.com/abbadon1334/PHPench)[ Packagist](https://packagist.org/packages/abbadon1334/phpench)[ RSS](/packages/abbadon1334-phpench/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHPench
=======

[](#phpench)

[![A pretty graph](graph.gif)](graph.gif)

PHPench creates a graphical output for a PHP benchmark. Plot the runtime of any function in realtime with GnuPlot and create an image out of the result.

[![Build Status](https://camo.githubusercontent.com/db1d56f0c1ccecde80006682cda5f9b63b774b255a1818e6480e54df11b3243e/68747470733a2f2f7472617669732d63692e6f72672f6d72652f504850656e63682e737667)](https://travis-ci.org/mre/PHPench)

Why is it useful?
-----------------

[](#why-is-it-useful)

#### Algorithms are beautiful

[](#algorithms-are-beautiful)

Sometimes the difference between two algorithms is hard to explain but easy to show.
For instance, take two sorting algorithms which both have a best-case runtime of `O(n*log n)`. Depending on the input, one can be much faster than the other. This tools helps you see what's going on.

#### Death to premature-optimizations

[](#death-to-premature-optimizations)

Whenever people tell you that using single quotes instead of double quotes around strings is a performance improvement, it's time to debunk some myths. Most of the time such programmer folklore turns out to be misguided and can actually be pretty harmful.
*"Premature emphasis on efficiency is a big mistake which may well be the source of most programming complexity and grief."* (Donald Knuth)
Let's be professionals. Let's measure.

Example
-------

[](#example)

Using PHPench feels a bit like writing a visual unit test. Check it out:

```
