PHP框架性能比较

admin 提交于 周五, 11/27/2015 - 16:59

数据显示,Laravel很慢,只有主流PHP框架1/3速度,内存则是主流框架2倍多。Symfony2表现令人满意,每秒可以处理250个请求,功能强大但速度和内存都不差。Drupal7比Drupal8快2-3倍。Drupal8的性能接近于Symfony2,每秒大概处理200个请求。对于登录用户,Drupal的速度会下降到原来的1/25左右,可见缓存在Web程序的性能里起决定性作用。

另外一篇文章显示Laravel比Symfony快10倍,看来对待PHP框架的性能测试结果需要非常谨慎。

  Laravel Symfony
Time taken for tests (sec) 0.958 8.438
Requests per second 104.43 11.85
Waiting for server response, min (ms) 22 101
Waiting for server response, median (ms) 475 4313
Waiting for server response, max (ms) 953 8434
Transfer rate (Kbytes/sec) 859.28 33.52

 

Resume

Although the frameworks were running in built-in PHP servers Laravel is about 10 times faster then Symfony. This small test shows us that if we will choose Symfony the problem of caching will be especially serios. The good news is we can optimize well our application using Http Cache. If we will use caching in Laravel we can reach even more perfomance, it is really fast framework.

参考:

标签

添加新评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"汉语"