2017 © Pedro Peláez
 

library profiler

Simple Profiler for PHP code and unit tests

image

jbzoo/profiler

Simple Profiler for PHP code and unit tests

  • PHP
  • 9 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 9 % Grown

The README.md

JBZoo Profiler Build Status Coverage Status

Simple Profiler for PHP code and unit tests

License Latest Stable Version Scrutinizer Code Quality, (*1)

Usage

use JBZoo\Profiler\Benchmark;

// Compare performance of functions
Benchmark::compare([
    'md5'   => function () {
        $string = str_repeat(mt_rand(0, 9), 1024 * 1024);
        return md5($string);
    },
    'sha1'  => function () {
        $string = str_repeat(mt_rand(0, 9), 1024 * 1024);
        return sha1($string);
    },
    'crc32' => function () {
        $string = str_repeat(mt_rand(0, 9), 1024 * 1024);
        return crc32($string);
    },
], array('count' => 500, 'name' => 'Hash functions'));

/* Result:

  ---------- Start benchmark: Hash functions  ----------
  Running tests 500 times
  PHP Overhead: time=58 ms; memory=0 B;

  Testing 1/3 : md5 ... Done!
  Testing 2/3 : sha1 ... Done!
  Testing 3/3 : crc32 ... Done!

  Name of test    Time, ms    Time, %     Memory    Memory, %
  crc32              1 551          ~    1.25 MB            ~
  md5                1 938         25    1.25 MB            ~
  sha1               2 776         79    1.25 MB            ~

  TOTAL TIME: 6 547.37 ms/4.36 ms;   MEMO: 41.05 KB/0.03 KB;   COUNT: 1 500
  ---------- Finish benchmark: Hash functions  ----------
*/

Benchmark::run(function () {
      $string = str_repeat(mt_rand(0, 9), 1024 * 1024);
      return md5($string);
  }, ['count' => 1000]),

Unit tests and check code style

make
make test-all

License

MIT, (*2)

The Versions

01/08 2016

dev-master

9999999-dev

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime leak memoryleak

01/08 2016

dev-develop

dev-develop

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime leak memoryleak

04/04 2016

1.0.5

1.0.5.0

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime

04/04 2016

1.0.4

1.0.4.0

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime

13/03 2016

1.0.3

1.0.3.0

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime

11/03 2016

1.0.2

1.0.2.0

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime

11/03 2016

1.0.1

1.0.1.0

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime

11/03 2016

1.0.0

1.0.0.0

Simple Profiler for PHP code and unit tests

  Sources   Download

MIT

The Requires

 

The Development Requires

phpunit tests timer benchmark performance memory profiler microtime