Download the PHP package dragon-code/runtime-comparison without Composer

On this page you can find all versions of the php package dragon-code/runtime-comparison. 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 runtime-comparison

Benchmark

Benchmark

Stable Version Total Downloads Github Workflow Status

Installation

Usage

[!NOTE]

When more than 9 iterations are used, the top and bottom 10% of results are excluded from the average calculation, producing cleaner data less dependent on external factors.

You can use both the bench() helper function and the Benchmark class (new Benchmark() or Benchmark::make()).

Callbacks can be passed as an array or as arguments, with or without named keys:

Example output:

Iterations Count

By default, the benchmark performs 100 iterations per callback. Use the iterations method to change this. The current iteration number is available as a callback parameter:

Warm-up

Use the warmup method to run each callback a few times before the measured iterations. Warm-up runs behave identically to regular ones (beforeEach / afterEach are invoked, the progress bar advances), but their time and memory are not included in the final statistics.

This stabilizes results by absorbing one-time costs such as cold caches, JIT/opcache priming and lazy autoloading.

Disabled by default.

Round Precision

Use the round method to set the number of decimal places in console output:

Deviation Values

Use the deviations method to measure the deviation between results. All loops will repeat the specified number of times, and the output will include a deviation row:

Callbacks

You can register callbacks to run before/after the entire benchmark loop or before/after each iteration:

The result of beforeEach is passed to the compare callback:

Results

toConsole

Outputs results to the console:

With deviation values:

toData

Returns results as an array of DragonCode\Benchmark\Data\ResultData DTO objects:

toAssert

Validates benchmark results against expected thresholds. Both from and till parameters are optional — use one or both:

Regression Testing

Detects performance regressions by comparing current results to a saved baseline (snapshot).

How To Work

[!NOTE]

Delete the corresponding .snap files to reset the baseline — the next run will recreate them.

Configuring the Snapshot Directory

Set the snapshot directory via snapshots(). Default: ./.benchmarks.

[!TIP]

Commit the generated snapshot files to version control to keep regression checks consistent across environments and CI.

toBeRegressionTime

Fails if execution time exceeds the snapshot by more than $max percent.

toBeRegressionMemory

Fails if memory usage exceeds the snapshot by more than $max percent.

Disable Progress Bar

License

This package is licensed under the MIT License.


All versions of runtime-comparison with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/console Version ^5.3 || ^6.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/runtime-comparison contains the following files

Loading the files please wait ...