Friends around the use of yaf frame, the discussion of the voice is also more, today nothing to see the blog, see a PHP mainstream of several framework performance comparison, more interesting, to share!
YAF is a PHP framework written in the form of PHP extensions, that is, written in C, and performance is an order of magnitude faster than the framework written by PHP code. The framework is likely to be the highest in terms of execution efficiency, because its author is xinchen
Case
Test the Router, Controller-to-Viewer in MVC, and output the "Hello World" simple page to test the performance of MVC in an ideal environment, simple logic, and frame-no-load.
3 indicators
1) Rough Execution time with microtime () and Memory_get_usage () in index.php, memory usage
2) Use the Facebook xhprof extension to get detailed resource usage, code execution function map
3) Concurrency Test
Hardware environment:
Cpu:intel Core i5 (2.67GHz x4)
Ram:4gb
Software Environment:
Debian 6.0.2 x86_64 (2.6.32-5-AMD64)
Apache 2.2.16
Mpm-prefork
Mod-php5
PHP 5.3.6
PHP-APC 3.1.3P1 (Global Unified Open APC support)
Framework Checklist for testing:
* Zf:zend Framework
Site:http://framework.zend.com
ver:1.11.7
* Ci:codeigniter
site:http://codeigniter.com/
ver:2.0.2
* Yii:yii Framework
site:http://www.yiiframework.com/
ver:1.1.8
* Yaf:yet another Framework in PHP Extension
site:http://code.google.com/p/yafphp/
ver:2.0.1
* MICROMVC:MICROMVC
site:http://www.micromvc.com/
ver:3.1.0
To test the code use case:
Https://github.com/eryx/labs/tree/master/php-framework-benchmark
Test results:
1. Coarse test: Memory consumption, response time
* Zf:zend Framework
* Ci:codeigniter
* Yii:yii Framework
* Yaf:yet another Framework in PHP Extension
* MICROMVC:MICROMVC
* All: summary comparison
Memory consumption
Execution time (milliseconds)
2. Xhprof: Implementation Details
* Zf:zend Framework
Executive Summary:
Detailed details of the execution:
* Ci:codeigniter
Executive Summary:
Detailed details of the execution:
* Yii:yii Framework
Executive Summary:
Detailed details of the execution:
* Yaf:yet another Framework in PHP Extension
Executive Summary:
Detailed details of the execution:
* MICROMVC:MICROMVC
Executive Summary:
Detailed details of the execution:
* All: summary comparison
Function call Amount
3. Concurrency testing
Ab-c 100-n 30000
Ab-c 200-n 50000
After reading the first reaction, YAF running speed is fast to catch up with the PHP source code, it feels like just PHP changed a way to run, then the framework inside the thing is sound? Because still do not know yaf, dare not comment too much!
PHP Framework MVC Benchmark Benchmark test