Magento在php7下速度测试

简介:

Magento performance is a recurrent problem for all developers and store owners. But PHP 7 is coming and you should think about using it very soon, benchmark is amazing!

Introduction

PHP community is waiting for it since months and PHP 7 is now Release Candidate as I am writing this article. It means that you are already able to test it against all your PHP applications and report any bug you found. I won’t talk about all the awesome features coming but rather focus on its usage with Magento.

Magento is based on its own framework that is also based on the Zend Framework which make any request using hundreds of PHP files and lines of code. It has always been a problem and you have probably tried all the possible improvements such as FPC, Magento Compilation, PHP and OPcache tweaking, Varnish or anything else that would have relieved your Magento installation. It is still useful to use these solutions but you can now also consider using PHP 7 really soon. I have made some basic benchmarking with PHP 5.5, PHP 5.6 and PHP 7 on a fresh Magento 1.9.2.0 installation with sample data installed. Results are amazing!

Benchmarking Magento 1.9 and PHP 7 (with sample data)

I have made these tests on my own MacBook Pro from the terminal. Hardware don’t really matter here since tests are all ran on a same basis. I have called all the URLs of the Magento Demo Store 5 times with cURL requests and for each PHP version.

Here is the result:

PHP 5.5

Show Details

PHP 5.6

Show Details

PHP 7.0

Show Details

Make your own tests

A minor incompatibility has to be fixed before using Magento with PHP 7.

You have to modify the file app/code/core/Mage/Core/Model/Layout.php on line 555:

Modify the line so it looks like this:

$this->getBlock($callback[0])->{$callback[1]}();

Conlusion

PHP 7 is still in Release Candidate state and should not be used in any production website yet of course. But just be aware of the upcoming releases and go make your own tests. This version is going to revolutionize PHP usage and applications. Can’t wait testing it with Magento 2 ;)

原文地址:http://www.bubblecode.net/en/2015/07/24/magento-php-7/

注:1、原作者做这个测试的时候php7还不是正式版,现在php7正式版已经发布了

2、Magento1.9要正常在php7环境跑起来,需要修改Mage_Core_Model_Layout类的代码,不过这个仅仅是保证跑起来,不能保证所有功能细节在php7环境下都正常,需要做更多严密的测试,期待Magento官方过段时间能提供补丁包来支持php7

3、附上迁移PHP5.6到PHP7指南一份:https://github.com/laruence/Migrating-from-PHP5.6.x-to-PHP7.0.x


目录
相关文章
原生php实现列表接口+分页接口+排序接口组合使用+包括测试数据(不加任何封装)
原生php实现列表接口+分页接口+排序接口组合使用+包括测试数据(不加任何封装)
原生php实现列表接口+分页接口+排序接口组合使用+包括测试数据(不加任何封装)
|
9月前
|
PHP 数据库
对PHP源码的测试
对PHP源码的测试
|
10月前
|
JSON 监控 前端开发
Zabbix监控系统PHP-API开发测试实录
Zabbix监控系统PHP-API开发测试实录
155 0
|
10月前
|
PHP Windows
php环境部署:phpstudy设置本地测试域名找不到hosts文件的解决方案
php环境部署:phpstudy设置本地测试域名找不到hosts文件的解决方案
206 0
|
10月前
|
JavaScript 数据库连接 PHP
php部署服务器后本地测试正常的页面顶部出现空白的(&#65279 BOM头)解决方案
php部署服务器后本地测试正常的页面顶部出现空白的(&#65279 BOM头)解决方案
65 0
|
11月前
|
PHP
PHP递归和循环的速度测试
写了一个可以对 $_GET`, `$_POST 等输入进行过滤的函数,做了PHP递归和循环的速度测试。
58 0
|
Web App开发 jenkins 测试技术
web自动化 基于python+Selenium+PHP+Ftp实现的轻量级web自动化测试框架
web自动化 基于python+Selenium+PHP+Ftp实现的轻量级web自动化测试框架
151 0
|
测试技术 PHP
PHP: PhpStorm单元测试报错:PHPUnit Cannot open file
PHP: PhpStorm单元测试报错:PHPUnit Cannot open file
77 0
|
Ubuntu 应用服务中间件 测试技术
php + nginx 网站并发压力测试及优化
测试工具: Apache 压力测试工具ab ab是针对apache的性能测试工具,可以只安装ab工具。 ubuntu安装ab
php + nginx 网站并发压力测试及优化