composer require iiispikeriii/speedy
print Speedy::test(Speedy::PHP_INC_PREF_POST);if you want to get only result speed testing - use onlyData param its true
print Speedy::test(Speedy::PHP_INC_PREF_POST, [], true);OR
$params = [
'name' => 'Speedy ++i vs i++',
'valueTest' => [100, 1000, 2000, 3000],
'qntTest' => 5,
'viewers' => [TestCore::VIEWER_TGROUP, TestCore::VIEWER_TAVG, TestCore::VIEWER_GBUBLE],
'tester' => ['name' => TestCore::TESTER_PHP], or 'tester' => TestCore::TESTER_PHP
];
print Speedy::test(Speedy::PHP_INC_PREF_POST, $params);TestCore::VIEWER_TLIST- table list resultTestCore::VIEWER_TGROUP- table group resultTestCore::VIEWER_TAVG- table average resultTestCore::VIEWER_GBUBLE- graph with buble result
Speedy::PHP_INC_PREF_POST- comparison with pre-increment postincrement (++i and i++)
TestCore::TESTER_PHP- testing with PHP functions microtime and memory_get_usageTestCore::TESTER_XHPROF- testing with extention XHProf, required XHProf.- xhprof_lib - path to xhprof_lib.php (not required)
- xhprof_runs - path to xhprof_runs.php (not required)
$myFunc1 = function($size)
{
... custom code ...
};
$myFunc2 = function($size)
{
... custom code ...
}; print Speedy::compare(['nameFunc1' => $myFunc1, 'nameFunc2' => $myFunc2]); OR
$params = [
'name' => 'Compare functions',
'valueTest' => [100, 1000, 2000, 3000],
'qntTest' => 5,
'viewers' => [TestCore::VIEWER_TLIST, TestCore::VIEWER_TGROUP, TestCore::VIEWER_TAVG, TestCore::VIEWER_GBUBLE],
'tester' => TestCore::TESTER_XHPROF,
];
print Speedy::compare(['nameFunc1' => $myFunc1, 'nameFunc2' => $myFunc2], $params);VIEWER_TLIST
VIEWER_TGROUP
VIEWER_TAVG
VIEWER_GBUBLE



