php Zend Framework 1 与 Zend Framework 2 性能对比

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12314300/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 03:19:25  来源:igfitidea点击:

Zend Framework 1 vs Zend Framework 2 performance

phpzend-frameworkzend-framework2

提问by tsergium

Zend Framework 2 was just released and Zend offers support for ZF1 for only 18 months from now. I know they were working for new features in ZF2 and then they were going to do some major speed improvements to it since it was 5 times slower than ZF1.

Zend Framework 2 刚刚发布,Zend 仅在 18 个月内提供对 ZF1 的支持。我知道他们正在为 ZF2 中的新功能工作,然后他们将对其进行一些重大的速度改进,因为它比 ZF1 慢 5 倍。

I would like to know how slower is ZF2 than ZF1 from benchmarks or tests you did and not pure speculation.

我想从您所做的基准测试或测试中了解 ZF2 比 ZF1 慢多少,而不是纯粹的猜测。

The latest benchmark I found is from February 22, 2012 and it concludes that ZF2 is 4 times slower than ZF1.

我发现的最新基准是 2012 年 2 月 22 日,得出的结论是 ZF2 比 ZF1 慢 4 倍。

Link here

链接在这里

回答by Karma

FAQ - (Answers based on personal experiment done yesterday)

常见问题 - (答案基于昨天的个人实验)

What has changed in Zend Framework 2 from Zend Framework 1?

Zend Framework 2 与 Zend Framework 1 相比有何变化?

Architecture

建筑学

ZF1 is based on MVC , ZF2 is based on MOVE. Huge difference. MOVE = Model Operations Views Events , MVC = Models Views Controllers. More here. Zend Framework 2 uses 100% object-oriented code and utilises most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures. source

ZF1基于MVC,ZF2基于MOVE。巨大的差异。MOVE = 模型操作视图事件,MVC = 模型视图控制器。更多在这里。Zend Framework 2 使用 100% 面向对象的代码并利用 PHP 5.3 的大部分新特性,即命名空间、后期静态绑定、lambda 函数和闭包。来源

Size of installation

安装尺寸

The latest ZF1 file is approx 30Mb and ZF2 is approx 2.5Mb (Zipped).

最新的 ZF1 文件大约为 30Mb,ZF2 大约为 2.5Mb(压缩)。

Dependency

依赖

ZF1 is core set of libraries and very loosely coupled architecture (with respect to its competitor/player - CakePHP). ZF1 does not require much of 'gems' (as in ruby) but, can do better with plugins. ZF2 requires you to know about composer- pharand soon it may out-match any other framework. New concept : Dependency Injectionfor Zend fans.

ZF1 是一组核心库和非常松散耦合的架构(相对于它的竞争对手/玩家 - CakePHP)。ZF1 不需要太多的“宝石”(如在 ruby​​ 中),但是使用插件可以做得更好。ZF2 要求您了解composer- phar并且很快它可能会超越任何其他框架。新概念:Zend 粉丝的依赖注入

Certification

认证

Certification is available only for ZF1, however, there are rumours about their talks for ZF2 certs though training material is available online.

认证仅适用于 ZF1,但是,尽管在线提供培训材料,但有传言称他们就 ZF2 认证进行了会谈。

Conventions

公约

classname in ZF1 was Zend_Db_Table for class in Zend/Db/Table.php whereas in ZF2, it is class My\Auth\Adapter . Enough said.

ZF1 中的类名是 Zend/Db/Table.php 中的类的 Zend_Db_Table 而在 ZF2 中,它是类 My\Auth\Adapter 。说够了。

Community

社区

ZF1 was backed by Zend Technologies (and few other, unnamed). ZF2 has remarkable supporters including Google and Microsoft. Source here

ZF1 得到 Zend Technologies(以及其他一些未命名的)的支持。ZF2 拥有包括谷歌和微软在内的非凡支持者。来源在这里

Speed

速度

It took approx 20 times more time to execute "Hello World!" in ZF2. I am not judging here. I could be wrong here. DIY.

执行“Hello World!”大约需要 20 倍以上的时间。在 ZF2 中。我不是在这里评判。我在这里可能是错的。DIY。

Which one should I opt for?

我应该选择哪一种?

MVC is been around since almost a decade and if you are one of them who are feeling sad for a new architecture altogether then hey! IT is 'your chosen' domain, keep up with the trends and update yourself! Start ZF2 from here.

MVC 已经存在将近十年了,如果您是其中一个对新架构感到悲伤的人,那么嘿!IT 是“您选择的”领域,紧跟潮流并更新自己!从这里启动 ZF2 。