Friday 10 April 2020

Benchmark between PHLAK\Config and Noodlehaus\Config Object

Benchmark between PHLAK\Config and Noodlehaus\Config Object

<?php
echo 'Welcome to the framework';

require_once 'vendor/autoload.php';

$bench = new Ubench;

$bench->start();

// // Execute some code
use Noodlehaus\Config;
use Noodlehaus\Parser\Json;
//use PHLAK\Config\Config;
// Load a single file mutiple time
//for ($i=0; $i < 2333; $i++) {
    //$config = Config::load('composer.json');
    $config = new Config('test.json');
//}




$bench->end();


use PHLAK\Config\Config;
0.0043570995330811
Peak memory: 2097152


Noodlehaus\Config Object
0.0045328140258789
Peak memory : 2097152



Both equally doing good a very small performance with PHLAK, so i decided to use PHLAK.

with direct php array in PHLAK
0.0019919872283936
Peak memory: 2097152


i am going to use php array directly or json if required

No comments:

Post a Comment