iiispikeriii/speedy 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iiispikeriii/speedy

Composer 安装命令:

composer require --dev iiispikeriii/speedy

包简介

testing speed for any platform

README 文档

README

It`s util for easy performance testing some functions.

Install

composer require iiispikeriii/speedy

Use

$speedy = new Speedy();
print $speedy->runTestByName(TestList::PHP_ARR_SORT);

OR

print Speedy::test(TestList::PHP_INC_PREF_POST);

if you want to get only result speed testing - use onlyData param its true

print Speedy::test(TestList::PHP_INC_PREF_POST, [], true);

OR

$params = [ 
    'name' => 'Speedy ++i vs i++',  
    'volumesTest' => [100, 1000, 2000, 3000], 
    'repeatTest' => 5, 
    'viewers' => [ViewerList::VIEWER_TGROUP, ViewerList::VIEWER_TAVG, ViewerList::VIEWER_GBUBLE], 
    'tester' => 'tester' => TesterList::TESTER_PHP
];  
print Speedy::test(TestList::PHP_INC_PREF_POST, $params);

Viewers

  • ViewerList::VIEWER_TLIST - table list result
  • ViewerList::VIEWER_TGROUP - table group result
  • ViewerList::VIEWER_TAVG - table average result
  • ViewerList::VIEWER_GBUBLE - graph with buble result

Tests

  • TestList::PHP_INC_PREF_POST - comparison with pre-increment postincrement (++i and i++)
  • TestList::PHP_ARR_READ - comparison with reading array "while" "for" "foreach"
  • TestList::PHP_ARR_SORT - comparison with sorting arrays Heap, Bubble, Select, Insertion, Quick
  • TestList::PHP_SOF_VS_COUNT - comparison with sizeof() versus count()

Testers

  • TesterList::TESTER_PHP - testing with PHP functions microtime and memory_get_usage
  • TesterList::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)

Compare custom functions

$myFunc1 =  function($size) 
{
    ... custom code ... 
};  
    
$myFunc2 = function($size)  
{
    ... custom code ... 
};  

every custome functions should take int parameter - workload from volumesTest

print Speedy::compare(['nameFunc1' => $myFunc1, 'nameFunc2' => $myFunc2]);  

OR

$params = [ 
    'name' => 'Compare functions',   
    'volumesTest' => [100, 1000, 2000, 3000], 
    'repeatTest' => 5, 
    'viewers' => [ViewerList::VIEWER_TLIST, ViewerList::VIEWER_TGROUP, ViewerList::VIEWER_TAVG, ViewerList::VIEWER_GBUBLE], 
    'tester' => TesterList::TESTER_XHPROF,
];  
print Speedy::compare(['nameFunc1' => $myFunc1, 'nameFunc2' => $myFunc2], $params);

Example viwers

VIEWER_TLIST

"table data list viewer"

VIEWER_TGROUP

"table data group viewer"

VIEWER_TAVG

"table data group viewer"

VIEWER_GBUBLE

"graph data buble viewer"

统计信息

  • 总下载量: 28
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固