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

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

mre/phpench
===========

A graphical PHP benchmarking tool

54274[3 issues](https://github.com/mre/PHPench/issues)PHP

Since Oct 21Pushed 6y ago6 watchersCompare

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

READMEChangelogDependenciesVersions (1)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:

```
