問題描述
Zend Framework 2 剛剛發布,Zend 僅在 18 個月內提供對 ZF1 的支持.我知道他們正在為 ZF2 中的新功能工作,然后他們將對其進行一些重大的速度改進,因為它比 ZF1 慢 5 倍.
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.
我想從您所做的基準測試或測試中了解 ZF2 比 ZF1 慢多少,而不是純粹的猜測.
I would like to know how slower is ZF2 than ZF1 from benchmarks or tests you did and not pure speculation.
我發現的最新基準是 2012 年 2 月 22 日,得出的結論是 ZF2 比 ZF1 慢 4 倍.
The latest benchmark I found is from February 22, 2012 and it concludes that ZF2 is 4 times slower than ZF1.
鏈接這里
推薦答案
FAQ - (答案基于昨天的個人實驗)
FAQ - (Answers based on personal experiment done yesterday)
Zend Framework 2 與 Zend Framework 1 相比有何變化?
架構
ZF1 基于 MVC,ZF2 基于 MOVE.巨大的差異.MOVE = 模型操作視圖事件,MVC = 模型視圖控制器.更多信息.Zend Framework 2 使用 100% 面向對象的代碼并利用 PHP 5.3 的大部分新功能,即命名空間、后期靜態綁定、lambda 函數和閉包.來源
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 文件大約 30Mb,ZF2 大約 2.5Mb(壓縮).
The latest ZF1 file is approx 30Mb and ZF2 is approx 2.5Mb (Zipped).
依賴
ZF1 是一組核心庫和非常松散耦合的架構(相對于它的競爭對手/玩家 - CakePHP).ZF1 不需要太多的寶石"(如在 ruby?? 中),但是使用插件可以做得更好.ZF2 要求您了解 composer - phar 很快它就可能超越任何其他框架.新概念:Zend 粉絲的依賴注入.
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 - phar and soon it may out-match any other framework. New concept : Dependency Injection for Zend fans.
認證
認證僅適用于 ZF1,不過,盡管在線提供培訓材料,但有傳言稱他們正在談論 ZF2 認證.
Certification is available only for ZF1, however, there are rumours about their talks for ZF2 certs though training material is available online.
約定
ZF1 中的類名是 Zend_Db_Table ,用于 Zend/Db/Table.php 中的類,而在 ZF2 中,它是類 MyAuthAdapter .說的夠多了.
classname in ZF1 was Zend_Db_Table for class in Zend/Db/Table.php whereas in ZF2, it is class MyAuthAdapter . Enough said.
社區
ZF1 得到 Zend Technologies(以及其他一些未命名的)的支持.ZF2 擁有卓越的支持者,包括谷歌和微軟.來源在這里
ZF1 was backed by Zend Technologies (and few other, unnamed). ZF2 has remarkable supporters including Google and Microsoft. Source here
速度
執行Hello World!"的時間增加了大約 20 倍.在 ZF2 中.我不是在這里評判.我在這里可能是錯的.自己動手做.
It took approx 20 times more time to execute "Hello World!" in ZF2. I am not judging here. I could be wrong here. DIY.
我應該選擇哪一個?
MVC 已經問世將近十年了,如果您是其中一個對新架構感到悲傷的人,那么嘿!IT 是您選擇的"領域,緊跟潮流并更新自己!從此處啟動 ZF2.
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.
這篇關于Zend Framework 1 與 Zend Framework 2 性能對比的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!