All Projects → mre → PHPench

mre / PHPench

Licence: Apache-2.0 license
Realtime benchmarks for PHP code

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to PHPench

Elinux
嵌入式 Linux 知识库 (elinux.org) 中文翻译计划;本项目发起人发布了《360° 剖析 Linux ELF》视频课程,欢迎订阅:https://www.cctalk.com/m/group/88089283
Stars: ✭ 193 (+264.15%)
Mutual labels:  realtime, profiling
Processhacker
A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware.
Stars: ✭ 6,285 (+11758.49%)
Mutual labels:  realtime, profiling
simplx
C++ development framework for building reliable cache-friendly distributed and concurrent multicore software
Stars: ✭ 61 (+15.09%)
Mutual labels:  realtime
microservice-graph-explorer
Navigate and explore all of the microservices in your application in real time using the real application connections.
Stars: ✭ 71 (+33.96%)
Mutual labels:  realtime
accelerator-textchat-ios
OpenTok Text Chat Accelerator Pack enables text messages between mobile or browser-based devices.
Stars: ✭ 13 (-75.47%)
Mutual labels:  realtime
revai-python-sdk
Rev AI Python SDK
Stars: ✭ 35 (-33.96%)
Mutual labels:  realtime
streamr-client-javascript
JS library for interacting with Streamr APIs: publishing and subscribing to data, creating streams, etc.
Stars: ✭ 35 (-33.96%)
Mutual labels:  realtime
intrinio-realtime-java-sdk
Intrinio Java SDK for Real-Time Stock Prices
Stars: ✭ 22 (-58.49%)
Mutual labels:  realtime
ghc-stack
Hacking GHC's Stack for Fun and Profit (featuring The Glorious Haskell Debugger v0.0.1 Pre-alpha)
Stars: ✭ 69 (+30.19%)
Mutual labels:  profiling
flutter feathersjs.dart
Communicate with your feathers js server from flutter app with unbelieved ease and make happy your customers.
Stars: ✭ 19 (-64.15%)
Mutual labels:  realtime
ui
PostgreSQL Editor and Dashboard
Stars: ✭ 128 (+141.51%)
Mutual labels:  realtime
benchmark VAE
Unifying Variational Autoencoder (VAE) implementations in Pytorch (NeurIPS 2022)
Stars: ✭ 1,211 (+2184.91%)
Mutual labels:  comparison
javascript-examples
Examples for the Convergence Real-time Collaboration Engine
Stars: ✭ 40 (-24.53%)
Mutual labels:  realtime
PowerShell-Watch
A PowerShell Watch-Command cmdlet for repeatedly running a command or block of code until a change in the output occurs.
Stars: ✭ 49 (-7.55%)
Mutual labels:  comparison
jtl-reporter
JtlReporter is an online application that allows users to generate beautiful, customizable and easy to understand performance reports from JMeter(Taurus), Locust, and other tools.
Stars: ✭ 85 (+60.38%)
Mutual labels:  comparison
jstackSeries.sh
Script for capturing a series of thread dumps from a Java process using jstack (on Linux and Windows)
Stars: ✭ 28 (-47.17%)
Mutual labels:  profiling
Radar
Arduino Servo controller with Ultrasonic sensor, that will send distance value from sensor to Node.js via USB serial and leveraging socket.io to send the data to browser in realtime.
Stars: ✭ 24 (-54.72%)
Mutual labels:  realtime
Collaborate-Board
Realtime collaborate board based on Firebase developed and written in Kotlin.
Stars: ✭ 25 (-52.83%)
Mutual labels:  realtime
vuo
A realtime visual programming language for interactive media.
Stars: ✭ 103 (+94.34%)
Mutual labels:  realtime
observable-profiler
Tracks new & disposed Observable subscriptions
Stars: ✭ 41 (-22.64%)
Mutual labels:  profiling

PHPench

A pretty graph

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

Why is it useful?

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

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

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

<?php

require_once __DIR__.'/../vendor/autoload.php';

/*
 * You can use an closure or a class that implements TestInterface.
 *
 * Data that will be processed by the tested function can be executed
 * without including its execution time. This will provide more accurate data.
 */

abstract class AbstractBenchmark implements \mre\PHPench\BenchmarkInterface
{
    protected $test;

    function setUp($arrSize)
    {
        $this->test = array();
        for ($i=1; $i<$arrSize; $i++) {
            $this->test[$i]= $arrSize % $i;
        }

        return $this->test;
    }
}

class BenchmarkArrayFlip extends AbstractBenchmark
{
    public function execute() {
        $test = array_flip(array_flip($this->test));
    }
}

class BenchmarkArrayUnique extends AbstractBenchmark
{
    public function execute() {
        $test = array_unique($this->test);
    }
}

// Create a new benchmark instance
$phpench = new \mre\PHPench(new \mre\PHPench\Aggregator\MedianAggregator);

// Use GnuPlot for output
$oOutput = new \mre\PHPench\Output\GnuPlotOutput('test2.png', 1024, 768);

// Alternatively, print the values to the terminal
//$oOutput = new \mre\PHPench\Output\CliOutput();

$oOutput->setTitle('Compare array_flip and array_unique');
$phpench->setOutput($oOutput);

// Add your test to the instance
$phpench->addBenchmark(new BenchmarkArrayFlip, 'array_flip');
$phpench->addBenchmark(new BenchmarkArrayUnique, 'array_unique');

// Run the benchmark and plot the results in realtime.
// With the second parameter you can specify
// the start, end and step for each call
$phpench->setInput(range(1,pow(2,16), 1024));
$phpench->setRepetitions(4);
$phpench->run();

Installation

1.) Add this package to your composer.json

{
    "require": {
      "mre/phpench": "*@dev"
    }
}

2.) Install gnuplot (Version 4.6)

For Mac OS X you can install gnuplot via homebrew. For live generated charts you also need to install XQuartz.

Without X11 support:
$ brew install homebrew/versions/gnuplot4

With X11 supprt (recommended!):
$ brew install homebrew/versions/gnuplot4 --with-x11

For Linux use your package manager.

apt-get install gnuplot

3.) Look at the examples for usage

Maintainers

Matthias Endler (@matthiasendler)
Markus Poerschke (@markuspoerschke)

License

Apache License Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].