PHP Benchmarking framework

Overview

CI Documentation Latest Stable Version Total Downloads License

PHPBench is a benchmark runner for PHP analogous to PHPUnit but for performance rather than correctness.

Features include:

  • Revolutions: Repeat your code many times to determine average execution time.
  • Iterations: Sample your revolutions many times and review aggregated statistical data.
  • Process Isolation: Each iteration is executed in a separate process.
  • Reporting: Customizable reports and various output formats (e.g. console, CSV, Markdown, HTML).
  • Report storage and comparison: Store benchmarks locally to be used as a baseline reference, or to reference them later.
  • Memory Usage: Keep an eye on the amount of memory used by benchmarking subjects.
  • Assertions: Assert that code is performing within acceptable limits, or that it has not regressed from a previously recorded baseline.

See the documentation to find out more.

Installation

$ composer require phpbench/phpbench --dev

See the installation instructions for more options.

Documentation

Documentation is hosted on readthedocs.

Community

Screenshots

Default output:

phpbench-standard

Blinken logger:

phpbench-blinken

HTML report:

phpbench2

Contributing

PHPBench is an open source project. If you find a problem or want to discuss new features or improvements please create an issue, and/or if possible create a pull request.

Comments
  • General discussion for usability

    General discussion for usability

    I'd like to suggest a couple of usability issues that came up using PHPBench for the first time:

    1. There should be a setUp() and tearDown() etc. by default - I don't like to add @BeforeMethods({"setUp"}) to every docblock
    2. The syntax of the data-provider was confusing to me - you should stick to PHPUnit and provide $param1, $param2 and $param3 instead of the single $params array
    3. Is there a way to use PHPBench with a continuous integration service like Travis CI? If not, I suggest you add something like a threshold that returns an error code if the benchmarks failed
    4. Tabular is great but you should truncate values that are longer than 20 characters: http://i.snag.gy/UNsRd.jpg
    5. Please use semantic versioning... 0.6.0 instead of 0.6

    Keep in mind, this is just a discussion - please create new issues for each one of the issues

    Thank you

    opened by henryruhs 13
  • Resources are not available with @BeforeMethods

    Resources are not available with @BeforeMethods

    I am trying to initialize some hash contexts (resources) as a #BeforeMethods, but it won't let me use it, because something is changes them.

    I attached a file and both bench functions should actually work, because they are using exactly the same code, except that one of them is using @BeforeMethods to initialize the hash, the other one is not.

    PhpHashBench.php.txt

    opened by ogmueller 12
  • composer deps for php8 ( php > 7.2)

    composer deps for php8 ( php > 7.2)

    Hey. Die festen bindungen an eine php version neven total weil 0.16 grundsätzlich auch unter php8 laufen kann. "php": "^7.2", (composer.json) ist in diversen tags hinterlegt und composer will nur mit gewallt installieren :-(

    also: php >= Version mit der es laufen muss oder "php": "^7.2 || ^7.3 || ^8.0" funktioniert wunderbar wenn man composer mit phpbench/phpbench: "*" configuriert (auf user seite) und composer --prefer-source nutzt um dessen unterstützung der dependeny checks erfolgreich zu erhalten. ich brauch eine version die laufen kann, nicht die stricte reduktion nichts mehr nutzen zu können :-) LG aus HH

    opened by flobee 11
  • Sanitize/calibrate functionality

    Sanitize/calibrate functionality

    I try to figure out if I can replace my own benchmark micro-framework with phpbench. I did a cursory search on documentation and the benchmarks-examples repository but failed to find what would be the best way to reimplement sanitize/calibrate functionality within phpbench (for example, check this class to see what I mean). Any suggestions?

    opened by rybakit 11
  • Comparing two dump-files does not work

    Comparing two dump-files does not work

    To reproduce:

    phpbench --report=aggregate --dump-file=fileA.xml --context="A"
    phpbench --report=aggregate --dump-file=fileB.xml --context="B"
    
    phpbench report --file=fileA.xml --file=fileB.xml --report=compare
    

    right from the docs.

    [InvalidArgumentException]
      Column "vcs_branch" does not exist, valid columns: "suite", "date", "stime", "benchmark_full", "groups", "params", "revs", "its", "mem_real", "mem_final", "mem_peak", "min", "max", "sum", "stdev", "mean", "mode", "variance", "rstdev", "best", "worst", "uname_os", "uname_host", "uname_release", "uname_version", "un
      ame_machine", "php_version", "php_xdebug", "baseline_nothing", "baseline_md5", "baseline_file_rw"  	
    Exception trace:
     PhpBench\Report\Generator\Table\Row->offsetGet() at C:\project\vendor\phpbench\phpbench\lib\Report\Generator\TableGenerator.php:261
     PhpBench\Report\Generator\TableGenerator->PhpBench\Report\Generator\{closure}() at C:\project\vendor\lstrojny\functional-php\src\Functional\Map.php:43
     Functional\map() at C:\project\vendor\phpbench\phpbench\lib\Report\Generator\TableGenerator.php:265
     PhpBench\Report\Generator\TableGenerator->PhpBench\Report\Generator\{closure}() at C:\project\vendor\lstrojny\functional-php\src\Functional\Map.php:43
     Functional\map() at C:\project\vendor\phpbench\phpbench\lib\Report\Generator\TableGenerator.php:266
     PhpBench\Report\Generator\TableGenerator->processCols() at C:\project\vendor\phpbench\phpbench\lib\Report\Generator\TableGenerator.php:106
     PhpBench\Report\Generator\TableGenerator->generate() at C:\project\vendor\phpbench\phpbench\lib\Report\ReportManager.php:56
     PhpBench\Report\ReportManager->generateReports() at C:\project\vendor\phpbench\phpbench\lib\Report\ReportManager.php:84
     PhpBench\Report\ReportManager->renderReports() at C:\project\vendor\phpbench\phpbench\lib\Console\Command\Handler\ReportHandler.php:41
     PhpBench\Console\Command\Handler\ReportHandler->reportsFromInput() at C:\project\vendor\phpbench\phpbench\lib\Console\Command\ReportCommand.php:87
     PhpBench\Console\Command\ReportCommand->execute() at C:\project\vendor\symfony\console\Command\Command.php:252
     Symfony\Component\Console\Command\Command->run() at C:\project\vendor\symfony\console\Application.php:936
     Symfony\Component\Console\Application->doRunCommand() at C:\project\vendor\symfony\console\Application.php:240
     Symfony\Component\Console\Application->doRun() at C:\project\vendor\symfony\console\Application.php:148
     Symfony\Component\Console\Application->run() at C:\project\vendor\phpbench\phpbench\lib\PhpBench.php:58
     PhpBench\PhpBench::run() at C:\project\vendor\phpbench\phpbench\bin\phpbench.php:24
     require() at C:\project\vendor\phpbench\phpbench\bin\phpbench:4
    
    opened by fhein 11
  • [RuntimeException] Could not launch script:

    [RuntimeException] Could not launch script:

    I get this Exception then i try to run phpbench on windows.

    [RuntimeException]
      Could not launch script:
    

    the command I am executing

    vendor\bin\phpbench.bat run benchmarks/StringifyBench.php
    

    Windows 10 1511 php 5.5.8

    please help me, I would love to use phpbench :)

    bug 
    opened by Kanti 11
  • Feature request: ability to import baseline/tagged benchmarks for runs

    Feature request: ability to import baseline/tagged benchmarks for runs

    Hi!

    I want to be able to export a specific tag to store it in git so I can compare future revisions of the code against it.

    One possibility I considered was storing the storage.xml_storage_path in git, but then my local runs would also be stored there and I would need to check if I accidentally added one to git every time. I find this too tedious and think there is a better way.

    Another example of what I have in mind is the way psalm handles baselines: you can provide a baseline file via command line or config and all errors it finds will be checked against it. I can also store the baseline file in git and it will be used by the CI to check if new errors where added by the changed code.

    Any idea if this is possible and desirable for enough people?

    opened by ricardoboss 10
  • Parameter sets broken in master?

    Parameter sets broken in master?

    When using c35e70b3a6ee7cdaf1a7048809b8e3dcb9f0f10f I'm seeing the following error:

    \Relay\Benchmarks\MgetBench::benchMgetUsingPredis
    
        PhpBench\Executor\Exception\ExecutionError
        Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($value) must be of type string, array given in /private/var/folders/cw/70xgjbbx7ps2mlhyqx24snbc0000gn/T/PhpBenchPz3t08:27
        Stack trace:
        #0 [internal function]: {closure}(Array)
        #1 /private/var/folders/cw/70xgjbbx7ps2mlhyqx24snbc0000gn/T/PhpBenchPz3t08(34): array_map(Object(Closure), Array)
        #2 {main}
          thrown in /private/var/folders/cw/70xgjbbx7ps2mlhyqx24snbc0000gn/T/PhpBenchPz3t08 on line 27
    
    
        #0 /Users/Till/Development/Repositories/relay/src/PhpBench/RedisExecutor.php(50): PhpBench\Executor\Benchmark\TemplateExecutor->execute(Object(PhpBench\Executor\ExecutionContext), Object(PhpBench\Registry\Config))
        #1 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/Benchmark/Runner.php(366): Relay\PhpBench\RedisExecutor->execute(Object(PhpBench\Executor\ExecutionContext), Object(PhpBench\Registry\Config))
        #2 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/Benchmark/Runner.php(308): PhpBench\Benchmark\Runner->runIteration(Object(Relay\PhpBench\RedisExecutor), Object(PhpBench\Registry\Config), Object(PhpBench\Model\Iteration), Object(PhpBench\Benchmark\Metadata\SubjectMetadata))
        #3 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/Benchmark/Runner.php(279): PhpBench\Benchmark\Runner->runVariant(Object(Relay\PhpBench\RedisExecutor), Object(PhpBench\Registry\Config), Object(PhpBench\Benchmark\RunnerConfig), Object(PhpBench\Benchmark\Metadata\SubjectMetadata), Object(PhpBench\Model\Variant))
        #4 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/Benchmark/Runner.php(197): PhpBench\Benchmark\Runner->runSubject(Object(Relay\PhpBench\RedisExecutor), Object(PhpBench\Benchmark\RunnerConfig), Object(PhpBench\Model\Subject), Object(PhpBench\Benchmark\Metadata\SubjectMetadata))
        #5 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/Benchmark/Runner.php(123): PhpBench\Benchmark\Runner->runBenchmark(Object(PhpBench\Benchmark\RunnerConfig), Object(PhpBench\Model\Benchmark), Object(PhpBench\Benchmark\Metadata\BenchmarkMetadata))
        #6 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/Console/Command/Handler/RunnerHandler.php(141): PhpBench\Benchmark\Runner->run(Object(Generator), Object(PhpBench\Benchmark\RunnerConfig))
        #7 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/Console/Command/RunCommand.php(134): PhpBench\Console\Command\Handler\RunnerHandler->runFromInput(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\StreamOutput), Object(PhpBench\Benchmark\RunnerConfig))
        #8 /Users/Till/Development/Repositories/relay/vendor/symfony/console/Command/Command.php(299): PhpBench\Console\Command\RunCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\StreamOutput))
        #9 /Users/Till/Development/Repositories/relay/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\StreamOutput))
        #10 /Users/Till/Development/Repositories/relay/vendor/symfony/console/Application.php(295): Symfony\Component\Console\Application->doRunCommand(Object(PhpBench\Console\Command\RunCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\StreamOutput))
        #11 /Users/Till/Development/Repositories/relay/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\StreamOutput))
        #12 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/lib/PhpBench.php(51): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\StreamOutput))
        #13 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/bin/phpbench.php(25): PhpBench\PhpBench::run()
        #14 /Users/Till/Development/Repositories/relay/vendor/phpbench/phpbench/bin/phpbench(4): require('/Users/Till/Dev...')
        #15 {main}
    

    This is how the @ParamProviders used to work:

    class GetThroughputBench extends BenchCase
    {
        /**
         * @ParamProviders("provideKeys")
         */
        public function benchGetThroughputOfRelayWarmed($params)
        {
            foreach ($params['keys'] as $key) {
                $this->relay->get($key);
            }
        }
    
        /**
         * Provides the keys for each benchmark.
         *
         * @return Generator
         */
        public function provideKeys()
        {
            $keys = [];
    
            foreach (static::loadJson('dataset-meteorites.json') as $landing) {
                $keys[] = "meteorite:{$landing->id}";
            }
    
            yield 'dataset' => [
                'keys' => $keys,
            ];
        }
    }
    
    regression 
    opened by tillkruss 10
  • Detect xdebug.use_compression and set correct extension

    Detect xdebug.use_compression and set correct extension

    Xdebug 3.1 enables compression of the cachegrind files automatically so the extension of the output by default is not .cachegrind but .cachegrind.gz.

    This patch adds a check to see if compression is enabled and then uses .cachegrind.gz instead of .cachegrind as extension.

    opened by blackwolf12333 9
  • `Could not find parselet for

    `Could not find parselet for "none" token` error

    I have put a simple example benchark into benchmarks/CustomerSoapBench.php:

    <?php
    
    namespace POM\benchmarks;
    
    use WebConnector\Customer\CustomerClientFactory;
    use WebConnector\Customer\Type\Read;
    
    class CustomerSoapBench {
        /**
         * @return void
         */
        public function benchRead() {
            $client = CustomerClientFactory::factory('https://'. WEBCONNECTOR_HOST .'/test_1094/CustomerIISWebService.svc?wsdl');
            $read = new Read('D83756');
            $client->read($read);
        }
    }
    

    placed my phpbench.json config beside it in benchmarks/ and invoked it from the project root like

    $ php vendor/bin/phpbench run benchmarks/CustomerSoapBench.php --report=default --config=benchmarks/phpbench.json  -vvv
    [DEBUG] Spawning process: C:\tools\php74\php.exe  "C:\Users\mstaab\AppData\Local\Temp\Php5FFA.tmp"
    
    [DEBUG] Spawning process: C:\tools\php74\php.exe  "C:\Users\mstaab\AppData\Local\Temp\Php60D6.tmp"
    
    PHPBench (dev-master) running benchmarks...
    with configuration file: C:/dvl/GitHub/philipp/benchmarks/phpbench.json
    with PHP version 7.4.13, xdebug ❌, opcache ❌
    
    [DEBUG] Spawning process: C:\tools\php74\php.exe  "C:\Users\mstaab\AppData\Local\Temp\Php629D.tmp"
    
    \POM\benchmarks\CustomerSoapBench
    
        benchRead...............................I0 [DEBUG] Spawning process: C:\tools\php74\php.exe -dmax_execution_time=0 "C:\Users\mstaab\AppData\Local\Temp\Php
    6389.tmp"
    
    
    In SyntaxError.php line 30:
    
      [PhpBench\Expression\Exception\SyntaxError]
      Could not find parselet for "none" token:
    
     " (" ~ rstdev(variant.time.avg) ~ ")"  mode) ~
            ----------------------------------------^
    
    
    Exception trace:
      at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Exception\SyntaxError.php:30
     PhpBench\Expression\Exception\SyntaxError::forToken() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Parser.php:89
     PhpBench\Expression\Parser->parseExpression() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Parselet\ConcatParselet.php:23
     PhpBench\Expression\Parselet\ConcatParselet->parse() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Parser.php:105
     PhpBench\Expression\Parser->parseExpression() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Parselet\ConcatParselet.php:23
     PhpBench\Expression\Parselet\ConcatParselet->parse() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Parser.php:105
     PhpBench\Expression\Parser->parseExpression() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Parser.php:64
     PhpBench\Expression\Parser->parseList() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\Parser.php:49
     PhpBench\Expression\Parser->parse() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\ExpressionLanguage\RealExpressionLanguage.php:29
     PhpBench\Expression\ExpressionLanguage\RealExpressionLanguage->parse() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Expression\ExpressionLanguage\Me
    moisedExpressionLanguage.php:31
     PhpBench\Expression\ExpressionLanguage\MemoisedExpressionLanguage->parse() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Progress\VariantSummaryForma
    tter.php:73
     PhpBench\Progress\VariantSummaryFormatter->formatVariant() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Progress\Logger\PhpBenchLogger.php:157
     PhpBench\Progress\Logger\PhpBenchLogger->formatIterationsFullSummary() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Progress\Logger\VerboseLogger.ph
    p:87
     PhpBench\Progress\Logger\VerboseLogger->variantEnd() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Benchmark\Runner.php:348
     PhpBench\Benchmark\Runner->endVariant() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Benchmark\Runner.php:310
     PhpBench\Benchmark\Runner->runVariant() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Benchmark\Runner.php:268
     PhpBench\Benchmark\Runner->runSubject() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Benchmark\Runner.php:196
     PhpBench\Benchmark\Runner->runBenchmark() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Benchmark\Runner.php:122
     PhpBench\Benchmark\Runner->run() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Console\Command\Handler\RunnerHandler.php:136
     PhpBench\Console\Command\Handler\RunnerHandler->runFromInput() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\Console\Command\RunCommand.php:134
     PhpBench\Console\Command\RunCommand->execute() at C:\dvl\GitHub\philipp\vendor\symfony\console\Command\Command.php:256
     Symfony\Component\Console\Command\Command->run() at C:\dvl\GitHub\philipp\vendor\symfony\console\Application.php:971
     Symfony\Component\Console\Application->doRunCommand() at C:\dvl\GitHub\philipp\vendor\symfony\console\Application.php:290
     Symfony\Component\Console\Application->doRun() at C:\dvl\GitHub\philipp\vendor\symfony\console\Application.php:166
     Symfony\Component\Console\Application->run() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\lib\PhpBench.php:51
     PhpBench\PhpBench::run() at C:\dvl\GitHub\philipp\vendor\phpbench\phpbench\bin\phpbench.php:25
     require() at C:\dvl\GitHub\philipp\vendor\bin\phpbench(21) : eval()'d code:3
     eval() at C:\dvl\GitHub\philipp\vendor\bin\phpbench:21
    
    run [--filter FILTER] [--group GROUP] [--parameters PARAMETERS] [--assert ASSERT] [--format FORMAT] [--revs REVS] [-l|--progress PROGRESS] [-b|--bootstrap BOO
    TSTRAP] [--executor EXECUTOR] [--stop-on-error] [--php-binary PHP-BINARY] [--php-config PHP-CONFIG] [--php-wrapper PHP-WRAPPER] [--php-disable-ini] [--report
    REPORT] [-o|--output OUTPUT] [--ref REF] [--file FILE] [--time-unit TIME-UNIT] [--precision PRECISION] [--mode MODE] [-d|--dump-file [DUMP-FILE]] [--dump] [--
    iterations ITERATIONS] [--warmup WARMUP] [-r|--retry-threshold RETRY-THRESHOLD] [--sleep SLEEP] [--tag TAG] [--store] [--tolerate-failure] [--] [<path>]
    
    

    my benchmarks/phpbench.json file looks like

    {
      "runner.bootstrap": "../app/portal/phpstan-bootstrap.php"
    }
    

    the phpstan-bootstrap.php is the same one I use successfully for phpstan and similar tools:

    <?php
    
    define('APP_ROOT', dirname(__DIR__, 2));
    define('APP_NAME', basename(__DIR__));
    define('APP_PATH', APP_ROOT.'/app/'.APP_NAME);
    define('PUBLIC_PATH', APP_ROOT.'/public/'.APP_NAME);
    
    $_SERVER['APP_MODE'] = 'development';
    define('APP_MODE', $_SERVER['APP_MODE']);
    
    // \cms\ViewTypeProvider requires a rocket path via vhost
    $_SERVER['ROCKET_PATH'] = APP_ROOT.'/vendor/plugins/rocket/';
    
    require_once APP_ROOT.'/vendor/autoload.php';
    include_once APP_ROOT.'/config/app.php';
    
    

    running on phpbench@dev-master from today at 8a5da09d52f44d223b467f98974b0bc5113f4c46

    $ php -v
    PHP 7.4.13 (cli) (built: Nov 24 2020 12:43:30) ( NTS Visual C++ 2017 x64 )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    

    on windows bash

    bug 
    opened by staabm 9
  • Ensure opcache optimizations are enabled when running benchmarks?

    Ensure opcache optimizations are enabled when running benchmarks?

    Related: https://wiki.php.net/rfc/opcache.no_cache

    In practice, most benchmarks run with the CLI SAPI, which has no opcache by default.

    I was wondering if phpbench should (at all) enforce opcache to be enabled, or warn when it isn't.

    Raised from https://github.com/lyrixx/php-bench/pull/5#issuecomment-637418989

    opened by Ocramius 9
  • Bump ramsey/composer-install from 1 to 2

    Bump ramsey/composer-install from 1 to 2

    Bumps ramsey/composer-install from 1 to 2.

    Release notes

    Sourced from ramsey/composer-install's releases.

    2.0.0

    Added

    • Use --prefer-stable with lowest dependencies (#178)
    • Allow use of a custom cache key (#167)
    • Allow ability to ignore the cache

    Changed

    Fixed

    • Fix case where working-directory did not run composer install in the correct working directory (#187)
    • Fix problems with retrieving cache with parallel builds (#161, #152)
    • Fix problems restoring from cache on Windows (#79)

    1.3.0

    • Support passing --working-dir as part of composer-options

    1.2.0

    • Support Composer working-directory option for when composer.json is in a non-standard location.
    • Add operating system name to the cache key.

    1.1.0

    Display Composer output with ANSI colors.

    1.0.3

    Patch release for dependency updates.

    1.0.2

    • Use the GitHub cache action directly to avoid duplication of code/effort.
    • Turn on output of Composer command to provide feedback in the job log
    • Use Composer cache-dir instead of cache-files-dir

    1.0.1

    Rewrite and refactor as a JavaScript action.

    Commits
    • 83af392 :sparkles: Add new custom-cache-suffix option (#239)
    • 7f9021e Fix use of deprecated set-output command (#238)
    • 4617231 Tests: update the included composer.phar from v 2.2.2 to 2.2.18 (#237)
    • 72896eb Add dependabot configuration file (#227)
    • 69e970d GH Actions: version update for codecov action runner (#226)
    • e3612f6 GH Actions: version update for actions/cache (#224)
    • d515102 GH Actions: version update for various predefined actions (#222)
    • 6085843 GH Actions: re-work the integration tests (#221)
    • f680dac test: add PHP path back to command, as well as debug message
    • 3c51967 test: ensure we use the alternate composer location
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Relative difference for throughput

    Relative difference for throughput

    When using the throughput output the relative difference isn't working.

    {
      "expressions": {
        "diff": "format(\"%.1fx (%.1f%%)\", mode(suite[subject_groups = [\"predis\"]][\"result_time_avg\"]) / mode(result_time_avg), percent_diff(mode(result_time_avg), mode(suite[subject_groups = [\"predis\"]][\"result_time_avg\"])))"
      }
    }
    

    When I run: ./vendor/bin/phpbench run --report=redis --filter=GetThroughputBench it works:

    ./vendor/bin/phpbench run --report=redis --filter=GetThroughputBench
    PHPBench (1.2.6) running benchmarks... #standwithukraine
    with configuration file: /Users/Till/Development/Repositories/relay/phpbench.json
    with PHP version 8.1.11, xdebug ❌, opcache ❌
    
    \CacheWerk\Relay\Benchmarks\Throughput\GetThroughputBench
    
        GET_Throughput_Predis...................I1 - Mo54,546ops/s (±2.24%)
        GET_Throughput_Credis...................I1 - Mo31,919ops/s (±1.16%)
        GET_Throughput_PhpRedis.................I1 - Mo33,001ops/s (±1.08%)
        GET_Throughput_Relay_NoCache............I1 - Mo59,426ops/s (±0.99%)
        GET_Throughput_Relay_WarmCache..........I1 - Mo4,934,810ops/s (±1.15%)
    
    Subjects: 5, Assertions: 0, Failures: 0, Errors: 0
    GetThroughputBench
    +--------------------------------+---------+-----+--------+-----------+----------------+-----------------+
    | subject                        | revs    | its | rstdev | mem_peak  | mode           | diff            |
    +--------------------------------+---------+-----+--------+-----------+----------------+-----------------+
    | GET_Throughput_Predis          | 50000   | 2   | ±2.24% | 1.073mb   | 54,546ops/s    | 1.0x (0.0%)     |
    | GET_Throughput_Credis          | 50000   | 2   | ±1.16% | 1.208mb   | 31,919ops/s    | 0.6x (-41.5%)   |
    | GET_Throughput_PhpRedis        | 50000   | 2   | ±1.08% | 808.544kb | 33,001ops/s    | 0.6x (-39.5%)   |
    | GET_Throughput_Relay_NoCache   | 50000   | 2   | ±0.99% | 808.560kb | 59,426ops/s    | 1.1x (8.9%)     |
    | GET_Throughput_Relay_WarmCache | 5000000 | 2   | ±1.15% | 808.560kb | 4,934,810ops/s | 90.5x (8947.1%) |
    +--------------------------------+---------+-----+--------+-----------+----------------+-----------------+
    

    But just running ./vendor/bin/phpbench run --report=redis skews it up:

    ./vendor/bin/phpbench run --report=redis
    PHPBench (1.2.6) running benchmarks... #standwithukraine
    with configuration file: /Users/Till/Development/Repositories/relay/phpbench.json
    with PHP version 8.1.11, xdebug ❌, opcache ❌
    
    \CacheWerk\Relay\Benchmarks\MgetBench
    
        MGET_Predis.............................I1 - Mo4.953ms (±1.01%)
        MGET_Credis.............................I1 - Mo7.148ms (±0.11%)
        MGET_PhpRedis...........................I1 - Mo6.127ms (±1.48%)
        MGET_Relay_NoCache......................I1 - Mo3.678ms (±0.54%)
        MGET_Relay_WarmCache....................I1 - Mo0.290ms (±3.29%)
    
    \CacheWerk\Relay\Benchmarks\Get\GetStringsBench
    
        GET_Strings_Predis......................I1 - Mo38.305ms (±0.60%)
        GET_Strings_Credis......................I1 - Mo66.388ms (±1.17%)
        GET_Strings_PhpRedis....................I1 - Mo64.149ms (±0.56%)
        GET_Strings_Relay_NoCache...............I1 - Mo34.167ms (±0.36%)
        GET_Strings_Relay_WarmCache.............I1 - Mo0.301ms (±0.58%)
    
    \CacheWerk\Relay\Benchmarks\Get\GetUnserializeBench
    
        GET_Unserialize_Predis..................I1 - Mo39.697ms (±1.13%)
        GET_Unserialize_Credis..................I1 - Mo69.264ms (±1.65%)
        GET_Unserialize_PhpRedis................I1 - Mo70.536ms (±0.89%)
        GET_Unserialize_Relay_NoCache...........I1 - Mo36.880ms (±1.91%)
        GET_Unserialize_Relay_WarmCache.........I1 - Mo0.484ms (±2.52%)
    
    \CacheWerk\Relay\Benchmarks\Throughput\GetThroughputBench
    
        GET_Throughput_Predis...................I1 - Mo54,231ops/s (±3.38%)
        GET_Throughput_Credis...................I1 - Mo30,230ops/s (±1.04%)
        GET_Throughput_PhpRedis.................I1 - Mo33,483ops/s (±0.64%)
        GET_Throughput_Relay_NoCache............I1 - Mo59,335ops/s (±0.47%)
        GET_Throughput_Relay_WarmCache..........I1 - Mo4,958,762ops/s (±1.01%)
    
    Subjects: 20, Assertions: 0, Failures: 0, Errors: 0
    MgetBench
    +----------------------+------+-----+--------+----------+---------+-------------------+
    | subject              | revs | its | rstdev | mem_peak | mode    | diff              |
    +----------------------+------+-----+--------+----------+---------+-------------------+
    | MGET_Predis          | 50   | 2   | ±1.01% | 1.342mb  | 4.953ms | 7.7x (669.3%)     |
    | MGET_Credis          | 50   | 2   | ±0.11% | 1.476mb  | 7.148ms | 5.3x (433.1%)     |
    | MGET_PhpRedis        | 50   | 2   | ±1.48% | 1.074mb  | 6.127ms | 6.2x (522.0%)     |
    | MGET_Relay_NoCache   | 50   | 2   | ±0.54% | 1.074mb  | 3.678ms | 10.4x (936.1%)    |
    | MGET_Relay_WarmCache | 50   | 2   | ±3.29% | 1.074mb  | 0.290ms | 131.3x (13026.5%) |
    +----------------------+------+-----+--------+----------+---------+-------------------+
    
    GetStringsBench
    +-----------------------------+------+-----+--------+----------+----------+-------------------+
    | subject                     | revs | its | rstdev | mem_peak | mode     | diff              |
    +-----------------------------+------+-----+--------+----------+----------+-------------------+
    | GET_Strings_Predis          | 10   | 2   | ±0.60% | 1.330mb  | 38.305ms | 1.0x (-0.5%)      |
    | GET_Strings_Credis          | 10   | 2   | ±1.17% | 1.465mb  | 66.388ms | 0.6x (-42.6%)     |
    | GET_Strings_PhpRedis        | 10   | 2   | ±0.56% | 1.065mb  | 64.149ms | 0.6x (-40.6%)     |
    | GET_Strings_Relay_NoCache   | 10   | 2   | ±0.36% | 1.065mb  | 34.167ms | 1.1x (11.5%)      |
    | GET_Strings_Relay_WarmCache | 10   | 2   | ±0.58% | 1.065mb  | 0.301ms  | 126.5x (12549.1%) |
    +-----------------------------+------+-----+--------+----------+----------+-------------------+
    
    GetUnserializeBench
    +---------------------------------+------+-----+--------+----------+----------+-----------------+
    | subject                         | revs | its | rstdev | mem_peak | mode     | diff            |
    +---------------------------------+------+-----+--------+----------+----------+-----------------+
    | GET_Unserialize_Predis          | 10   | 2   | ±1.13% | 1.331mb  | 39.697ms | 1.0x (-4.0%)    |
    | GET_Unserialize_Credis          | 10   | 2   | ±1.65% | 1.467mb  | 69.264ms | 0.6x (-45.0%)   |
    | GET_Unserialize_PhpRedis        | 10   | 2   | ±0.89% | 1.065mb  | 70.536ms | 0.5x (-46.0%)   |
    | GET_Unserialize_Relay_NoCache   | 10   | 2   | ±1.91% | 1.065mb  | 36.880ms | 1.0x (3.3%)     |
    | GET_Unserialize_Relay_WarmCache | 10   | 2   | ±2.52% | 1.065mb  | 0.484ms  | 78.8x (7775.8%) |
    +---------------------------------+------+-----+--------+----------+----------+-----------------+
    
    GetThroughputBench
    +--------------------------------+---------+-----+--------+-----------+----------------+-------------------------+
    | subject                        | revs    | its | rstdev | mem_peak  | mode           | diff                    |
    +--------------------------------+---------+-----+--------+-----------+----------------+-------------------------+
    | GET_Throughput_Predis          | 50000   | 2   | ±3.38% | 1.073mb   | 54,231ops/s    | 2066.5x (206546.3%)     |
    | GET_Throughput_Credis          | 50000   | 2   | ±1.04% | 1.208mb   | 30,230ops/s    | 1151.9x (115091.6%)     |
    | GET_Throughput_PhpRedis        | 50000   | 2   | ±0.64% | 808.544kb | 33,483ops/s    | 1275.9x (127485.1%)     |
    | GET_Throughput_Relay_NoCache   | 50000   | 2   | ±0.47% | 808.560kb | 59,335ops/s    | 2261.0x (225995.5%)     |
    | GET_Throughput_Relay_WarmCache | 5000000 | 2   | ±1.01% | 808.560kb | 4,958,762ops/s | 188953.7x (18895269.2%) |
    +--------------------------------+---------+-----+--------+-----------+----------------+-------------------------+
    

    Maybe related to #974. The code: https://github.com/cachewerk/relay

    opened by tillkruss 4
  • Bump actions/setup-python from 3 to 4.1.0

    Bump actions/setup-python from 3 to 4.1.0

    Bumps actions/setup-python from 3 to 4.1.0.

    Release notes

    Sourced from actions/setup-python's releases.

    v4.1.0

    In scope of this pull request we updated actions/cache package as the new version contains fixes for caching error handling. Moreover, we added a new input update-environment. This option allows to specify if the action shall update environment variables (default) or not.

    Update-environment input

        - name: setup-python 3.9
          uses: actions/setup-python@v4
          with:
            python-version: 3.9
            update-environment: false
    

    Besides, we added such changes as:

    v4.0.0

    What's Changed

    • Support for python-version-file input: #336

    Example of usage:

    - uses: actions/setup-python@v4
      with:
        python-version-file: '.python-version' # Read python version from a file
    - run: python my_script.py
    

    There is no default python version for this setup-python major version, the action requires to specify either python-version input or python-version-file input. If the python-version input is not specified the action will try to read required version from file from python-version-file input.

    • Use pypyX.Y for PyPy python-version input: #349

    Example of usage:

    - uses: actions/setup-python@v4
      with:
        python-version: 'pypy3.9' # pypy-X.Y kept for backward compatibility
    - run: python my_script.py
    
    • RUNNER_TOOL_CACHE environment variable is equal AGENT_TOOLSDIRECTORY: #338

    • Bugfix: create missing pypyX.Y symlinks: #347

    • PKG_CONFIG_PATH environment variable: #400

    • Added python-path output: #405

    ... (truncated)

    Commits
    • c4e89fa Improve readme for 3.x and 3.11-dev style python-version (#441)
    • 0ad0f6a Merge pull request #452 from mayeut/fix-env
    • f0bcf8b Merge pull request #456 from akx/patch-1
    • af97157 doc: Add multiple wildcards example to readme
    • 364e819 Merge pull request #394 from akv-platform/v-sedoli/set-env-by-default
    • 782f81b Merge pull request #450 from IvanZosimov/ResolveVersionFix
    • 2c9de4e Remove duplicate code introduced in #440
    • 412091c Fix tests for update-environment==false
    • 78a2330 Merge pull request #451 from dmitry-shibanov/fx-pipenv-python-version
    • 96f494e trigger checks
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Numeric table columns in report should be aligned right

    Numeric table columns in report should be aligned right

    In a cli report table, to properly compare numbers, columns with numbers should:

    • be aligned right (\STR_PAD_LEFT).
    • use the same measuring unit (e.g. not ms in one record, but µs in another record).
    • ideally, a unit should be used where all values are > 1, so that big numbers visually stick out with additional digits to the left. (for these last points I currently use --mode=throughput --time-unit=s as cli parameters)

    For the first point, I found that the following addition in TableRenderer::render() has the desired effect for the main table:

            $style = (new TableStyle())->setPadType(\STR_PAD_LEFT);
            $nColumns = \count($object->columnNames());
            for ($iCol = 2; $iCol < $nColumns; ++$iCol) {
                $consoleTable->setColumnStyle($iCol, $style);
            }
    

    However, this is obviously the wrong place to do this. I am hard-coding the rule that every column except the first two should be aligned right, which is true for the final overview table but not universally for every table.

    What the code example shows is that the symfony console table component can align numbers right.

    opened by donquixote 3
  • Later benchmarks are notoriously slower, possibly due to CPU throttling

    Later benchmarks are notoriously slower, possibly due to CPU throttling

    Problem

    I have a test case like this:

    class MyBench {
      public function benchA1() {...}
      public function benchB1() {...}
      public function benchA1() {
        ... // Exact copy of benchA1().
      }
      public function benchB1() {
        ... // Exact copy of benchB1().
      }
    }
    

    When running all of them, the later (copied) version is notoriously slower than the previous version. E.g. A2 will be slower than A1, and B2 will be slower than B1. I saw differences higher than 10%, and this was reproducible.

    I assume this is because the processor gets heated and will throttle when it hits the later benchmark cases.

    This can lead to misleading results when comparing the performance of different algorithms.

    Solution 1: Sleep

    We can use the --sleep parameter or @Sleep annotribute, hoping that the processor will cool down. I tried with --revs=1 --iterations=50 --sleep=10000, it seems to improve stability sometimes, but the problem does not fully go away. Perhaps I need to use higher sleep numbers?

    One problem with this is that a user won't see if the sleep number was "high enough", because usually there are no 1:1 copied benchmark methods.

    Solution 2: Mix it up

    In the past, I created a custom benchmark tool where I would break the strict ordering of benchmark cases. E.g. I would run A, B, A, B, A, B instead of A, A, A, B, B, B.

    While this makes a more "fair" comparison of A vs B in the current run, it does not help with differences to earlier runs, where the CPU might have been less heated.

    Solution 3: Pre-stress the processor

    Heat up the processor so that all the benchmark cases suffer from the same throttling.

    I don't know if a processor will reach a fixed throttling level, or if it will throttle more and more. I assume it depends on many factors.

    Solution 4: Measure current raw CPU speed?

    A reference operation could be used to measure the current CPU speed. A report could show benchmark times divided by the duration for the reference operation.

    Problems with this:

    • The divided number will be an imaginary unit, because the reference operation is completely arbitrary.
    • There might be high variation in the reference operation measurements.
    • Resources used for the reference operation might be different than for the benchmark operation, so the division might distort the results.
    opened by donquixote 3
Releases(1.2.7)
  • 1.2.7(Oct 15, 2022)

    Improvements:

    • Remove dependency on webmozart/path (copied the class into PHPBench)
    • Update PHPStan to 1.0 and fix new errors #1006
    • Use webmozart/glob instead of glob for benchmark paths and config include paths #1005

    Bug fixes:

    • Fix bad exception call #1002 @TRowbotham
    • Fix comma formatting of numbers with no zero decimal precision #1008
    Source code(tar.gz)
    Source code(zip)
  • 1.2.6(Jul 19, 2022)

  • 1.2.5(Mar 6, 2022)

  • 1.2.4(Mar 5, 2022)

  • 1.2.3(Dec 24, 2021)

  • 1.2.2(Dec 11, 2021)

  • 1.2.1(Dec 4, 2021)

  • 1.2.0(Nov 6, 2021)

    Features:

    • [expression] Support binary memory units #934
    • [reporting] Ability to expand table columns dynamically #928
    • [reporting] Ability to group columns #928
    • [reporting] Added benchmark_compare default report #928
    • [cli] Ability to filter by variant #938
    • [cli] Ability to filter reports #940

    Improvements:

    • [storage] Allow . in tag names
    • [runner] Do not show warning when unable to load metadata for benchmark IF the runner.file_pattern is specified #941

    Bug fixes:

    • Fix property (.) access precedence, it is now the same as [ array access #928
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(711.87 KB)
    phpbench.phar.asc(833 bytes)
  • 1.1.3(Oct 31, 2021)

  • 1.1.2(Sep 25, 2021)

  • 1.1.1(Sep 8, 2021)

  • 1.1.0(Aug 15, 2021)

    Features:

    • Allow env vars to be passed to the benchmark process.
    • Allow config files to include other config files via. $include and $include-glob #989
    • Added contains function to see if a value exists in a list.
    • Added frame function to create a new data frame within an expression.
    • Added sum and count functions #865
    • New component based report generator #851
    • HTML Bar Chart component #853
    • Console Bar Chart component #858
    • Data Frame and Expression Filtering #831
    • Allow multiple benchmark paths to be specified from CLI #834
    • Functions which require at least one value return NULL when values are empty #835
    • Add --limit option to log command #879
    • Add bare-vertical report configuration (same as --report='extends: bare,{"vertical": true}) #879

    Improvement:

    • Surpress reports if errors were encountered during the run #912
    • Support expressions in parttion specifications
    • Data can be accessed on any expression value (not just "parameters")
    • Use automatic time unit for expression report #838
    • Parameter handling refactored to be "safe": objects will not be unserialized in the PHPBench process #845
    • Allow single quoted strings in expressions (better with JSON) #895

    Other changes:

    • Lists and data frames can no longer be compared. Use the frame function to convert a list to a data frame (in the unlikely event you compare a list with a frame in a report).
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(703.91 KB)
    phpbench.phar.asc(833 bytes)
  • 1.0.4(Jul 18, 2021)

  • 1.0.3(Jul 3, 2021)

    Bug fix:

    • Show warning if file is read/reflected but it is not a benchmark file. #883

      Files that are not suffixed with Bench.php are reflected and their docblocks are parsed. Causing unexpected errors if unknown docblock tags are present.

      As changing this behavior (introduced by error in 2016) is a B/C break, it will not be changed in a bug-fix release.

      An option runner.file_pattern has been added however to enable the warnings to be resolved.

    Improvement:

    • Show warning if metadata could not be loaded for benchmark instead of an exception.
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(655.61 KB)
    phpbench.phar.asc(833 bytes)
  • 1.0.2(May 28, 2021)

  • 1.0.1(May 11, 2021)

  • 1.0.0(May 9, 2021)

    1.0.0

    (changes vs. 1.17)

    B/C breaks:

    • Progress logger: startSuite now additionally accepts RunnerConfig
    • Removed self-update functionality (suggest using phive instead(.
    • Most configuration option names have changed. All options are now prefixed by their extension name, e.g. bootstrap => runner.bootstrap, path => runner.path, extensions => core.extensions. See the configuration [documentation(https://phpbench.readthedocs.io/en/latest/configuration.html) for a full reference.
    • Removed time_unit and time_mode configuration settings, as they are replaced by runner.time_unit and runner.time_mode.
    • Environment provider baseline renamed to sampler to avoid concept-conflict with the runner baselines.
    • Extensions grouping related functionalities have been extracted from the CoreExtension, this will change the location of some constants used (e.g. CoreExtension::TAG_PROGRESS_LOGGER is now RunnerExtension::PROGRESS_LOGGER.
    • Renamed travis progress logger to plain
    • Removed awareness of CONTINUOUS_INTEGRATION environment variable
    • Removed table report generator, it is replaced by the expression generator which is now used to produce the default and aggregate reports. The output and configuration is largely the same, but some features have been removed.
    • html and markdown output formats have been removed temporarily.
    • --uuid renamed to --ref and tag: prefix removed #740
    • No warnings - if assertion fails within tolerance zone then it is OK
    • Assertion DSL has been replaced (only applicable vs. previous alpha versions)
    • BenchmarkExecutorInterface#execute() must now return an ExecutionResults object.
    • TemplateExecutor: expect an array for the time measurement result instead of an int.
    • Extensions use the Symfony OptionsResolver instead of provding an array of default values (which is in line with how other parts of PHPBench are working).
    • Executors accept a single, immutable ExecutionContext instead of the mutable SubjectMetadata and Iteration
    • Renamed the microtime executor to remote.
    • OutputInterface is injected from the DI conatiner, OutputAwareInterface has been removed.
    • DBAL extension removed.
    • PHPBench Reports extension removed.
    • Removed Xdebug Trace integration
    • Removed --query featre (only worked with DBAL, too complex).
    • Removed --context (depreacted in favor of --tag).
    • Removed archive and delete commands.
    • Assertions now accept a single expression rather than a set of configuration options.
    • Type hints have been added in most places - possibly causing issues with any extensions.
    • Assets (storage, xdebug profiles) are now placed in .phpbench
    • Services referenced via. fully qualified class names instead of strings.

    Features:

    • Added --working-dir option
    • Option to include the baseline rows in the expression report.
    • Progress output is sent to STDERR, report output to STDOUT (enable you to pipe the output)
    • Allow --theme= selection and configuration.
    • Allow benchmarks to be configued in the config (runner.{iterations,revs,time_unit,mode,etc})
    • Include collected environmental information in the report data #789
    • Allow providers to be enabled/disabled via. env.enabled_providers #789
    • Support @RetryThreshold annotation, attribute, and runner.retry_threshold configuration.
    • Introduced bare report generator - provides all raw available report data
    • Introduced display_as_time function to handle formatting time with throughput.
    • Null coalesce function introduced in expression language
    • Support true color expression rendering #767
    • Added expression report generator - will eventually replace the tablereport used for aggregate and defaultreports.
    • Added --format to customize the summary shown in progress loggers
    • String concatenation for expression language
    • Show debug details (process spawning) with -vvv
    • Support Xdebug 3
    • Support for PHP 8 Attributes
    • New Expression Lanaugage
    • Introduced remote_script_remove and remote_script_path options to assist in debugging.
    • Added local executor - execute benchmarks with in the same process as PHPBench.
    • Configuration profiles
    • Xdebug extension is loaded by default if extension is loaded
    • Baseline: Specify baseline suite when running benchmarks and show differences in reports #648
    • Assert against the baseline
    • Show PHP version and the status of Xdebug and Opcache in the runner output #649
    • Add @Timeout to enable a timeout to be specified for any given benchmark - @dantleech #614

    Improvements:

    • Optionaly support for binary data in param providers #532
    • Support serializable objects in param providers #823
    • Use package versions to show PHPBench version if not PHAR
    • Removed "summary" line from default progress output.
    • Automatically detect time or memory units by default, added meta-units time and memory
    • Unconditionally enable xdebug extension (previously the entire extension was hidden if Xdebug wasn't installed)
    • "local" executor will include non-existing benchmark classes and bootstrap
    • Configuation options have generated documentation
    • Preserve types in env information
    • Make default true color theme compatible with light backgrounds.
    • Added vertical layout to bare report (vertical: true).
    • Removed best and worst columns by default from default report.
    • Default to showing all columns in expression report
    • Standard deviation in default report is shown as time
    • Relative SD is color gradiated
    • Trunacte long syntax error messages
    • Automatically sign PHAR on release
    • Dynamically resolve timeunit / precision from expression (progress/report) #775
    • Support specificaion of display-as precision in expression language
    • Allow the display unit to be evaluated (for dynamically determining the unit based on the subject's preference)
    • Make the display unit a node - allowing it to be pretty printed.
    • Improved memory formatting (thousands separator, use abbreviated suffix)
    • Show difference to baseline in progress loggers.
    • Highlight assertion failures.
    • Decorator added to improve error reporting for method executors.
    • Benchmarks executed as they are found (no eager metadata loading)
    • Allow direct reference to services (e.g. --executor=debug without need for a debug configuration).
    • Colourful indication of success/failure/warnings when assertions are used.
    • Allow multiple paths to be specified in config
    • Add type restrictions to config values
    • All assets now placed in .phpbench directory in CWD (instead of ./_storage and ./xdebug
    • --tag implicitly stores the benchmark (no need to additionally use --store)
    • Decrease benchmark overhead by rendering parameters in-template - @marc-mabe

    Bug fix:

    • Fix regression which requires phpbench to be installed with composer 2 #822
    • Unterminated XML reference #818 - @staabm
    • Parent directory for custom script path not created #739 - @alexandrajulius
    • Windows newline is not understood in expression language #817 - @dantleech
    • @OutputTimeUnit doesn't propagate to default expression time unit #766
    • Numeric tags cause an error #717
    • Benchmark errors cause reports to error
    • Undefined console formatter subtitle #729
    • Missing formatters not defined in correct place #727
    • Use text instead of string for envrionment key for DBAL storage - @flobee
    • Numeric tags are not found.
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(643.01 KB)
    phpbench.phar.asc(833 bytes)
  • 1.0.0-beta2(May 1, 2021)

    B/C breaks:

    • Progress logger: startSuite now additionally accepts RunnerConfig

    Improvements:

    • Use package versions to show PHPBench version if not PHAR
    • Display hint to indicate what is being compared
    • Display the Mo prefix as a node (i.e. it can have highlighting applied to it)

    Bug fixes:

    • Unterminated XML reference #818 - @staabm
    • Parent directory for custom script path not created #739 - @alexandrajulius
    • Windows newline is not understood in expression language #817 - @dantleech
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(650.42 KB)
    phpbench.phar.asc(833 bytes)
  • 1.0.0-beta1(Apr 13, 2021)

    1.0.0-beta1

    B/C breaks:

    • Most configuration option names have changed. All options are now prefixed by their extension name, e.g. bootstrap => runner.bootstrap, path => runner.path, extensions => core.extensions. See the configuration documentation for a full reference.
    • Removed time_unit and time_mode configuration settings, as they are replaced by runner.time_unit and runner.time_mode.
    • Environment provider baseline renamed to sampler to avoid concept-conflict with the runner baselines.

    Improvements:

    • Removed "summary" line from default progress output.
    • Automatically detect time or memory units by default, added meta-units time and memory
    • Unconditionally enable xdebug extension (previously the entire extension was hidden if Xdebug wasn't installed)
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(662.74 KB)
    phpbench.phar.asc(833 bytes)
  • 1.0.0-alpha9(Apr 12, 2021)

    B/C Breaks:

    • Extensions grouping related functionalities have been extracted from the CoreExtension, this will change the location of some constants used (e.g. CoreExtension::TAG_PROGRESS_LOGGER is now RunnerExtension::PROGRESS_LOGGER.
    • Renamed travis progress logger to plain
    • Removed awareness of CONTINUOUS_INTEGRATION environment variable

    Features:

    • Added --working-dir option
    • Option to include the baseline rows in the expression report.
    • Progress output is sent to STDERR, report output to STDOUT (enable you to pipe the output)
    • Allow --theme= selection and configuration.
    • Allow benchmarks to be configued in the config (runner.{iterations,revs,time_unit,mode,etc})
    • Include collected environmental information in the report data #789
    • Allow providers to be enabled/disabled via. env.enabled_providers #789
    • Support @RetryThreshold annotation, attribute, and runner.retry_threshold configuration.

    Improvements:

    • "local" executor will include non-existing benchmark classes and bootstrap
    • Configuation options have generated documentation
    • Preserve types in env information
    • Make default true color theme compatible with light backgrounds.
    • Added vertical layout to bare report (vertical: true).
    • Removed best and worst columns by default from default report.
    • Default to showing all columns in expression report
    • Standard deviation in default report is shown as time
    • Relative SD is color gradiated
    • Trunacte long syntax error messages

    Other:

    • Automatically sign PHAR on release
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(661.69 KB)
    phpbench.phar.asc(833 bytes)
  • 1.0.0-alpha8(Mar 28, 2021)

    This release replaces much of the reporting layer, switching it to be based on expressions.

    BC Breaks:

    • Removed table report generator, it is replaced by the expression generator which is now used to produce the default and aggregate reports. The output and configuration is largely the same, but some features have been removed.
    • html and markdown output formats have been removed temporarily.

    Features:

    • Expression report: replaces the table report.
    • Introduced bare report generator - provides all raw available report data
    • Introduced display_as_time function to handle formatting time with throughput.
    • Null coalesce function introduced in expression language

    Improvements:

    • Dynamically resolve timeunit / precision from expression (progress/report) #775
    • Support specificaion of display-as precision in expression language
    • Allow the display unit to be evaluated (for dynamically determining the unit based on the subject's preference)
    • Make the display unit a node - allowing it to be pretty printed.
    • Improved memory formatting (thousands separator, use abbreviated suffix)
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(653.84 KB)
  • 1.0.0-alpha7(Mar 20, 2021)

    • Support true color expression rendering #767
    • Added expression report generator - will eventually replace the tablereport used for aggregate and defaultreports.
    • Added --format to customize the summary shown in progress loggers
    • String concatenation for expression language
    • Show debug details (process spawning) with -vvv
    • Support Xdebug 3

    Bug fixes:

    • @OutputTimeUnit doesn't propagate to default expression time unit #766
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(666.90 KB)
  • 1.0.0-alpha6(Feb 28, 2021)

  • 1.0.0-alpha5(Feb 27, 2021)

  • 1.0.0-alpha4(Dec 29, 2020)

    1.0.0-alpha-4

    Bug fixes:

    • Numeric tags cause an error #717
    • Benchmark errors cause reports to error
    • Undefined console formatter subtitle #729
    • Missing formatters not defined in correct place #727

    Improvements:

    • Colourful indication of success/failure/warnings when assertions are used.
    • Allow multiple paths to be specified in config
    • Add type restrictions to config values
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(590.48 KB)
  • 1.0.0-alpha3(Nov 28, 2020)

    Backward compatiblity breaks:

    • BenchmarkExecutorInterface#execute() must now return an ExecutionResults object.
    • TemplateExecutor: expect an array for the time measurement result instead of an int.
    • Extensions use the Symfony OptionsResolver instead of provding an array of default values (which is in line with how other parts of PHPBench are working).
    • Executors accept a single, immutable ExecutionContext instead of the mutable SubjectMetadata and Iteration
    • Renamed the microtime executor to remote.
    • OutputInterface is injected from the DI conatiner, OutputAwareInterface has been removed.

    Features:

    • Introduced remote_script_remove and remote_script_path options to assist in debugging.
    • Added local executor - execute benchmarks with in the same process as PHPBench.

    Improvements:

    • Decorator added to improve error reporting for method executors.
    • Benchmarks executed as they are found (no eager metadata loading)
    • Allow direct reference to services (e.g. --executor=debug without need for a debug configuration).
    Source code(tar.gz)
    Source code(zip)
    phpbench.phar(577.39 KB)
  • 0.17.1(Jun 13, 2020)

  • 0.17.0(Jan 16, 2020)

Owner
PHPBench
PHP Benchmarking Framework
PHPBench
Slim Framework Tracy Debugger Bar

Slim Framework Tracy Debugger Bar configure it by mouse now in package: Panel Description Slim Framework - Slim Environment RAW data Slim Container RA

null 72 Aug 29, 2022
🔴 First class integration of Sentry to Nette Framework (@nette)

Website ?? contributte.org | Contact ????‍?? f3l1x.io | Twitter ?? @contributte Usage To install latest version of contributte/sentry use Composer. co

Contributte 3 Dec 15, 2022
Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

PHP Console server library PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things u

Sergey 1.4k Dec 25, 2022
PHP APM (Alternative PHP Monitor)

APM (Alternative PHP Monitor) APM (Alternative PHP Monitor) is a monitoring extension enabling native Application Performance Management (APM) for PHP

Patrick Allaert 310 Dec 4, 2022
Zipkin PHP is the official PHP Tracer implementation for Zipkin

Zipkin PHP is the official PHP Tracer implementation for Zipkin, supported by the OpenZipkin community. Installation composer require openz

Open Zipkin 250 Nov 12, 2022
Debug bar for PHP

PHP Debug Bar Displays a debug bar in the browser with information from php. No more var_dump() in your code! Features: Generic debug bar Easy to inte

Maxime Bouroumeau-Fuseau 4k Jan 8, 2023
Xdebug — Step Debugger and Debugging Aid for PHP

Xdebug Xdebug is a debugging tool for PHP. It provides step-debugging and a whole range of development aids, such as stack traces, a code profiler, fe

Xdebug 2.8k Jan 3, 2023
Kint - a powerful and modern PHP debugging tool.

Kint - debugging helper for PHP developers What am I looking at? At first glance Kint is just a pretty replacement for var_dump(), print_r() and debug

null 2.7k Dec 25, 2022
😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

Tracy - PHP debugger Introduction Tracy library is a useful helper for everyday PHP programmers. It helps you to: quickly detect and correct errors lo

Nette Foundation 1.6k Dec 23, 2022
The Interactive PHP Debugger

The interactive PHP debugger Implemented as a SAPI module, phpdbg can exert complete control over the environment without impacting the functionality

Joe Watkins 841 Oct 9, 2022
Dontbug is a reverse debugger for PHP

Dontbug Debugger Dontbug is a reverse debugger (aka time travel debugger) for PHP. It allows you to record the execution of PHP scripts (in command li

Sidharth Kshatriya 709 Dec 30, 2022
PHP Debug Console

PHP Console A web console to try your PHP code into Creating a test file or using php's interactive mode can be a bit cumbersome to try random php sni

Jordi Boggiano 523 Nov 7, 2022
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source lib to make a debug in php direct in terminal, without necessary configure an IDE. Th

Renato Cassino 190 Dec 3, 2022
PCOV - CodeCoverage compatible driver for PHP

PCOV A self contained CodeCoverage compatible driver for PHP Requirements and Installation See INSTALL.md API /** * Shall start recording coverage in

Joe Watkins 613 Dec 21, 2022
Low-overhead sampling profiler for PHP 7+

phpspy phpspy is a low-overhead sampling profiler for PHP. For now, it works with Linux 3.2+ x86_64 non-ZTS PHP 7.0+ with CLI, Apache, and FPM SAPIs.

Adam 1.3k Dec 24, 2022
The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function that you can use instead of var_dump().

VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function t

Symfony 7.1k Jan 1, 2023
PHP errors for cool kids

whoops PHP errors for cool kids whoops is an error handler framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debu

Filipe Dobreira 12.9k Dec 24, 2022
Clockwork - php dev tools in your browser - server-side component

Clockwork is a development tool for PHP available right in your browser. Clockwork gives you an insight into your application runtime - including requ

its 4.8k Dec 29, 2022
Laravel Debugbar (Integrates PHP Debug Bar)

Laravel Debugbar This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to th

Barry vd. Heuvel 14.8k Jan 9, 2023