Download the PHP package dragon-code/benchmark without Composer

On this page you can find all versions of the php package dragon-code/benchmark. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package benchmark

Benchmark

the dragon code benchmark

Stable Version Unstable Version Total Downloads Github Workflow Status

Installation

To get the latest version of The Dragon Code: Benchmark, simply require the project using Composer:

Or manually update require-dev block of composer.json and run composer update console command:

Using

Note

The result of the execution is printed to the console, so make sure you call the code from the console.

Result example:

When measuring the average value among the results, when more than 10 iterations are used, the final data is filtered by peak values. The calculation of the 10% of the lowest and 10% of the highest values is excluded from the total result, thus the final data becomes cleaner and less dependent on any external factors.

Iterations Count

By default, the benchmark performs 100 iterations per callback, but you can change this number by calling the iterations method:

If the passed value is less than 1, then one iteration will be performed for each callback.

You can also get the number of the current execution iteration from the input parameter:

Without Data

If you want to see only the summary result of the run time without detailed information for each iteration, then you can call the withoutData method, which will display only the summary information:

Result example:

Note

If the option to display detailed information is enabled (without using the withoutData method) and more than 1000 iterations are requested, then the output of detailed information will be forcibly disabled, since there will be absolutely no point in it with a significantly increasing load on the computer.

Round Precision

By default, the script does not round measurement results, but you can specify the number of decimal places to which rounding can be performed.

For example:

Result example:

Prepare Data

In some cases, it becomes necessary to call some action before starting each check cycle so that its time does not fall into the result of the runtime check. There is a prepare method for this:

When calling a callback, the name and iteration parameters are passed to it. If necessary, you can use this information inside the callback function.

You can also get the number of the current iteration and the result of the execution of the preliminary function from the input parameter:

Information

License

This package is licensed under the MIT License.


All versions of benchmark with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
dragon-code/support Version ^6.10
symfony/console Version ^6.0 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dragon-code/benchmark contains the following files

Loading the files please wait ....