安哥网络 发表于 2015-9-7 17:16:42

yii、yaf、ci等php框架性能对比

yii、yaf、ci等php框架性能对比
刚和朋友的聊天过程中,认识到yaf,yaf是远程c写的框架,整个php框架写成了扩展。php启动的时候便加载到内存,速度性能远比php写的框架强很多,但是使用ide相对麻烦一些,性能绝对赞。翻译了一片国外的框架性能对比文章.案例本次测试输出简单的hello word,简单MVC逻辑,(Router -> Controller -> Viewer),没有数据库连接,没有任何逻辑.硬件平台
CPU: Intel Core i5 750 (2.67GHz x4)
RAM: 4GB软件环境Debian 6.0.4 x86_64 (2.6.32-41)apache 2.2.16 (mpm-prefork,mod-php5)php 5.3.10
php-apc 3.1.9 (Optimization for include/require)Copy all projects to /dev/shm/* (Optimization for files read/write)PHP框架列表* zf: Zend Framework
Site: http://framework.zend.com
Ver: 1.11.11* zf2: Zend Framework
Site: http://framework.zend.com
Site: https://github.com/zendframework/ZendSkeletonApplication
Ver: 2.0.0-beta1* symfony: symfony
Site: http://www.symfony-project.org
Ver: 2.0.0* cakephp: CakePHP
Site: http://cakephp.org
Ver: 2.0.4* ci: CodeIgniter
Site: http://codeigniter.com
Ver: 2.1.0* yii: Yii Framework
Site: http://www.yiiframework.com
Ver: 1.1.8* micromvc4: MicroMVC
Site: http://www.micromvc.com
Ver: 4.0.0* laravel: Laravel, A PHP Framework For Web Artisans
Site: http://laravel.com
Ver: 2.0.2* slim: Slim Framework
Site: http://www.slimframework.com
Ver: 1.5.0* yaf: Yet Another Framework in PHP Extension
Site: http://code.google.com/p/yafphp
Ver: 2.1.3-beta (yaf.cache_config=1)* FuelPHP: Simple, Flexible, Community driven Web Framework
Site: http://fuelphp.com/
Ver: 1.1* ColaPHP:
Site: http://code.google.com/p/colaphp/
Ver: 1.2-ga# XHProf: A Hierarchical Profiler for PHP
Site: http://pecl.php.net/xhprof
Ver: 0.9.2# The source code of this testing:
Source: https://github.com/eryx/php-framework-benchmark1. Apache BenchmarkRequests pre second (-c 100 -n 30000), the bigger is better
http://www.hooto.com/media/image/view/?id=942&style=full请求/秒(-c 200 -n 50000), 数值越大越好
http://www.hooto.com/media/image/view/?id=943&style=full2. 系统负载
压力测试一分钟内完成的负载图
越小越好(-c 100 -n 30000)
http://www.hooto.com/media/image/view/?id=944&style=full3. 内存使用率
测试hello word占用的内存,越小越好.
http://www.hooto.com/media/image/view/?id=945&style=full4. 响应时间
页面的响应时间.单位微妙
http://www.hooto.com/media/image/view/?id=946&style=full5. 调用方法的数量(Facebook XHProf)
单个hello word页面调用了多少方法,zend5620个方法,是不是太臃肿了。
http://www.hooto.com/media/image/view/?id=947&style=full详细的函数调用图
Symfony2http://www.hooto.com/media/image/view/?id=949&style=thumbZend Framework 1.11.1http://www.hooto.com/media/image/view/?id=915&style=thumb
Zend Framework 2.0.0-beta1http://www.hooto.com/media/image/view/?id=916&style=thumbCakePHP 2.0.4http://www.hooto.com/media/image/view/?id=917&style=thumb
CodeIgniter 2.1.0http://www.hooto.com/media/image/view/?id=918&style=thumbYii Framework 1.1.8http://www.hooto.com/media/image/view/?id=919&style=thumb
Slim 1.5http://www.hooto.com/media/image/view/?id=920&style=thumbLaravel 2.0.2http://www.hooto.com/media/image/view/?id=921&style=thumb
MicroMVC 4.0.0http://www.hooto.com/media/image/view/?id=922&style=thumbYaf 2.1.3-betahttp://www.hooto.com/media/image/view/?id=923&style=thumb
FuelPHP 1.1http://www.hooto.com/media/image/view/?id=939&style=thumbColaPHP 1.2http://www.hooto.com/media/image/view/?id=940&style=thumb
6. 文件数量
打开hellow word用到included or required in 文件的数量.越小越好,zend很多,yii19个,yaf才4个,不快才怪。
http://www.hooto.com/media/image/view/?id=948&style=full
原文地址:http://www.ruilog.com/blog/view/b6f0e42cf705.html摘自:http://www.ttlsa.com/php/yii-yaf-ci-php/

yii、yaf、ci等php框架性能对比
页: [1]
查看完整版本: yii、yaf、ci等php框架性能对比